Check for `ObjectContaining` on either side of equality.

- Also clean up `undefined` check.

Fixes #682