Okay, that's weird. Technically @cymplecy is right, we don't guarantee the order, so this isn't technically a bug; on the other hand, the code is trying to produce the order you expect. It's failing, apparently, because a computation that should produce 1 is instead producing a floating point value slightly more than 1, and the ceil() function is turning that into 2. It's probably fixable by making the code less clever, but Jens might not want to do that, to avoid making it slower. Anyway, don't hold your breath.