Check other kinds of class equality

Fixes #179.