Improve robustness of fractional offset calculations.