Fix timestamp comparison