Fixed for loop initalized variables not being scoped in the loop.