Fix how to check if a class exists.