Prevent floating point errors on OS X