Fix floating point rounding error