Fixed rounding error problem