From what you've posted, this should work just fine. It's not your entire code, though. Without the entire code, it's hard to find errors like this.
Anyway... you might be running into a problem because you have an inner loop that runs to nFinal, while your outer loop runs to nFinal + 1. This will make your outer loop actually loop to 2*nFinal, because the inner loop will be executed twice (each time nFinal times).
If that doesn't answer your question, post your entire code.