Null-safe compare methods.