/* Note, we stop the loop on the first plugin that matches the name */
    foreach_alist(plugin, plugin_list) {
-      Dmsg3(dbglvl, "plugin=%s cmd=%s len=%d\n", plugin->file, cmd, len);
-      if (strncmp(plugin->file, cmd, len) != 0) {
+      Dmsg4(0, "plugin=%s plen=%d cmd=%s len=%d\n", plugin->file, plugin->len, cmd, len);
+      if ((plugin->len != len) || (strncmp(plugin->file, cmd, len) != 0)) {
          i++;
          continue;
       }
 
 
       plugin = new_plugin();
       plugin->file = bstrdup(result->d_name);
+      plugin->len = strstr(plugin->file, "-fd.") - plugin->file;
       plugin->pHandle = dlopen(fname.c_str(), RTLD_NOW);
       if (!plugin->pHandle) {
          Jmsg(NULL, M_ERROR, 0, _("Plugin load %s failed: ERR=%s\n"),