Fix issues due to floating point errors.