Fixed subclass handling so that it will work on Class (in addition to instances of Class).