Timestamp sorting fix