Fix a ClassCastException when isEqualTo(DateValue) fails