return (0);
 }
 
-static int normalize_hostname (char *dst, const char *src)
+static int mangle_dots (char *dst, const char *src)
 {
     size_t i;
 
         const char *prefix, const char *ds_name)
 {
     int  status;
-    char *n_hostname;
+    char *n_hostname = 0;
+    char *n_ds_name = 0;
 
     assert (plugin != NULL);
     assert (type != NULL);
         return (-1);
     }
 
-    if (normalize_hostname(n_hostname, hostname) == -1)
+    if (mangle_dots(n_hostname, hostname) == -1)
     {
         ERROR ("Unable to normalize hostname");
         return (-1);
     }
 
+    if (ds_name && ds_name[0] != '\0') {
+        if (mangle_dots(n_ds_name, ds_name) == -1)
+        {
+            ERROR ("Unable to normalize datasource name");
+            return (-1);
+        }
+    }
+
     if ((plugin_instance == NULL) || (plugin_instance[0] == '\0'))
     {
         if ((type_instance == NULL) || (type_instance[0] == '\0'))