Improvements to the time offset calculations