DWIM, correct checking of an object's class
