diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js
index 2384920..aa8079e 100644
--- a/core/misc/machine-name.js
+++ b/core/misc/machine-name.js
@@ -29,13 +29,13 @@ Drupal.behaviors.machineName = {
   attach: function (context, settings) {
     var self = this;
     var $context = $(context);
-    var source_id, options, machine;
+    var source_id, options, machine, data;
 
-    function clickEditHandler() {
-      $wrapper.show();
-      $target.focus();
-      $suffix.hide();
-      $source.unbind('.machineName');
+    function clickEditHandler(e) {
+      e.data.wrapper.show();
+      e.data.target.focus();
+      e.data.suffix.hide();
+      e.data.source.unbind('.machineName');
       return false;
     }
 
@@ -44,15 +44,15 @@ Drupal.behaviors.machineName = {
       // Set the machine name to the transliterated value.
       if (machine !== '') {
         if (machine !== options.replace) {
-          $target.val(machine);
-          $preview.html(options.field_prefix + Drupal.checkPlain(machine) + options.field_suffix);
+          e.data.target.val(machine);
+          e.data.preview.html(options.field_prefix + Drupal.checkPlain(machine) + options.field_suffix);
         }
-        $suffix.show();
+        e.data.suffix.show();
       }
       else {
-        $suffix.hide();
-        $target.val(machine);
-        $preview.empty();
+        e.data.suffix.hide();
+        e.data.target.val(machine);
+        e.data.preview.empty();
       }
     }
 
@@ -98,15 +98,22 @@ Drupal.behaviors.machineName = {
           return;
         }
 
+        data = {
+          source: $source,
+          target: $target,
+          suffix: $suffix,
+          wrapper: $wrapper,
+          preview: $preview
+        }
         // If it is editable, append an edit link.
-        var $link = $('<span class="admin-link"><a href="#">' + Drupal.t('Edit') + '</a></span>').click(clickEditHandler);
+        var $link = $('<span class="admin-link"><a href="#">' + Drupal.t('Edit') + '</a></span>').click(data, clickEditHandler);
         $suffix.append(' ').append($link);
 
         // Preview the machine name in realtime when the human-readable name
         // changes, but only if there is no machine name yet; i.e., only upon
         // initial creation, not when editing.
         if ($target.val() === '') {
-          $source.bind('keyup.machineName change.machineName', machineNameHandler)
+          $source.bind('keyup.machineName change.machineName', data, machineNameHandler)
           // Initialize machine name preview.
           .keyup();
         }
