Added missing var scope in for loops
Merge pull request #47 from dikklop/master

Added missing var scope in for loops