Added declaration of loop variable in simple counting for-loops.
Added function-scope.