Fix handling of special characters in prefix names