Fix sorting by time.