fixed rounding errors