Added class checking to __eq__ function

Relates to Issue #774