Some tweaks and fixes for integer cycling.
Merge pull request #1124 from hjoliver/integer-cycling-tweaks

Fixes a bug in integer cycling.