Fix handling of class names containing dashes