Added check to __eq__ to short-circuit out if the other object
does not have the necessary attributes.