 		let numberOfRegisteredClasses = objc_getClassList(nil, 0)
 		let allClasses = UnsafeMutablePointer<AnyClass?>.allocate(capacity: Int(numberOfRegisteredClasses))
 		let autoreleasingAllClasses = AutoreleasingUnsafeMutablePointer<AnyClass>(allClasses)
-		let actualClassCount = objc_getClassList(autoreleasingAllClasses, numberOfRegisteredClasses)
 		
-		for i in 0..<actualClassCount {
+		let actualNumberOfClasses = objc_getClassList(autoreleasingAllClasses, numberOfRegisteredClasses)
+		
+		let iterationCount = actualNumberOfClasses < numberOfRegisteredClasses ? actualNumberOfClasses : numberOfRegisteredClasses
+		
+		for i in 0..<iterationCount {
 			if let currentClass = allClasses[Int(i)] {
 				let superclass: AnyClass? = class_getSuperclass(currentClass)
 				

		
	}
	
	public func allSubclasses() -> [T.Type] {
		let matches = allSubclassesAsAnyObject()
		

			}
		}
		
		allClasses.deallocate()
		
		return matches
	}
