fix bogus iteration
Merge pull request #19 from darkv/iteration_patch

Fix loop iteration