Fix time calculation.