Fix bad behaviour for integer cycling with P.