Fixed problem where start time could be greater than end time.