Check is_object before calling is_subclass_of
Closes #7.