Fix infinite loop in ClassName.fromClass()