Fix problem with off-by-one rounding error.