fix HasSubclass and tests