Fix simulation of RoundToNearest