Fix bug were loop counter wasn't initialized properly at the end of the loop.