Fixed bug in iterator

Closes https://github.com/PistonDevelopers/piston/issues/211
Merge pull request #215 from bvssvni/master

Fixed bug in iterator