fixed issue with named class definition: has to be equivalent, subclass not sufficient