Fixed bug in iterator

Closes https://github.com/PistonDevelopers/piston/issues/211