Fix time_difference calculation.