Fix i variable leak
Fix more i variable leaks
Merge pull request #12 from sebmck/master

Fix i variable leaks