Corrected helpers getClassInstancesCount()