explicitly only go from 1..i
fix the infinite loop hopefully for good
Merge pull request #486 from luvit/fixes/infinite_loop

Fixes/infinite loop