Reusing `i` was causing an infinite loop in a certain scenario.
Merge pull request #6 from mponizil/fix-loop

Reusing `i` was causing an infinite loop in a certain scenario.