Fix time calculations.