Fix time sorting