You might be on to something with the value wrap-around. I would try changing the loop, outputting a couple of hundred values. See if that has an effect. I haven't got a board handy at the moment to try it on.
@pakrat: No input is unwelcome! Apart from 250 volts input at the fingertips. That was pretty unwelcome.