Timestamp comparison bug fixes