Remove unnecessary count condition
Add compatibility hack for ClassType class