Fix time-of function.