Fix an infinite loop in ClassName.fromClass()