fix rounding errors