Fixes rounding error bug