Fix: toSafeClassName to return sanitized class name