Remove trailing \ in strings when testing class names.