fix global leak of loop variable `i`
Merge pull request #16 from crisson/master

fix global leak of loop variable `i`