Fixed the time functions.