Fix timestamp/date ordering bug