diff --git a/form_builder.js b/form_builder.js
index 32ab259..6be5ce6 100644
--- a/form_builder.js
+++ b/form_builder.js
@@ -15,6 +15,10 @@ Drupal.behaviors.formBuilderElement.attach = function(context) {
   if ($(context).is('div.form-builder-wrapper:not(.form-builder-processed)')) {
     $wrappers = $wrappers.add(context);
   }
+  // If the context itself is an element, add to the list.
+  else if ($(context).is('div.form-builder-element:not(.form-builder-processed)')) {
+    $elements = $elements.add(context);
+  }
 
   // Add a guard class.
   $wrappers.addClass('form-builder-processed');
@@ -154,6 +158,12 @@ Drupal.behaviors.formBuilderTabs.attach = function(context) {
 Drupal.behaviors.formBuilderDeleteConfirmation = {};
 Drupal.behaviors.formBuilderDeleteConfirmation.attach = function(context) {
   var $confirmForm = $('form.confirmation', context);
+
+  // If the confirmation form is the context.
+  if ($(context).is('form.confirmation')) {
+    $confirmForm = $(context);
+  }
+
   if ($confirmForm.length) {
     $confirmForm.submit(Drupal.formBuilder.deleteField);
     $confirmForm.find('a').click(Drupal.formBuilder.clickCancel);
@@ -504,7 +514,7 @@ Drupal.formBuilder.updateElement = function(response) {
     // Expand root level fieldsets after updating to prevent them from closing
     // after every update.
     $new.children('fieldset.collapsible').removeClass('collapsed');
-    Drupal.attachBehaviors($new.parent().get(0));
+    Drupal.attachBehaviors($new.get(0));
   }
 
   // Set the variable stating we're done updating.
diff --git a/includes/form_builder.properties.inc b/includes/form_builder.properties.inc
index 21658cf..1ccb04a 100644
--- a/includes/form_builder.properties.inc
+++ b/includes/form_builder.properties.inc
@@ -34,6 +39,31 @@ function form_builder_property_key_form_validate($element, $form_state) {
   if (!preg_match('/^[a-z0-9_]+$/', $element['#value'])) {
     form_error($element, t('The form key may only contain lowercase alphanumeric characters and underscores.'));
   }
+
+  // Check that the new key does not conflict with an existing key.
+  if ($element['#value'] != $element['#default_value']) {
+    $active_form = form_builder_active_form();
+    $form = form_builder_cache_load($active_form['form_type'], $active_form['form_id']);
+    $parents = $element['#parents'];
+    array_pop($parents);
+    $parents[] = $element['#value'];
+    $key_exists = FALSE;
+    foreach ($parents as $key) {
+      if (isset($form[$key])) {
+        $form = $form[$key];
+        $key_exists = TRUE;
+      }
+      else {
+        $key_exists = FALSE;
+        break;
+      }
+    }
+
+    if ($key_exists) {
+      form_error($element, t('The form key %key is already in use.', array('%key' => $element['#value'])));
+    }
+  }
+
 }
 
 /**
