Implements hacky fix for rounding error weirdness.