Fix comparing with object of different type.