Date comparison fix