loop off-by-one noticed by Moonlightning

Moonlightning notices these small off-by-ones in the loop.

We'd ignore any mode 'z' because of it.