diff --git a/fallback_formatter.admin.js b/fallback_formatter.admin.js
index 04218db..2ee188e 100644
--- a/fallback_formatter.admin.js
+++ b/fallback_formatter.admin.js
@@ -1,49 +1,58 @@
-(function ($) {
+(function ($, Drupal) {
 
-Drupal.behaviors.formatterStatusStatus = {
-  attach: function (context, settings) {
-    $('.fallback-formatter-status-wrapper input.form-checkbox', context).once('fallback-formatter-status', function () {
-      var $checkbox = $(this);
-      // Retrieve the tabledrag row belonging to this filter.
-      var $row = $('#' + $checkbox.attr('id').replace(/-status$/, '-weight'), context).closest('tr');
-      // Retrieve the vertical tab belonging to this filter.
-      var tab = $('#' + $checkbox.attr('id').replace(/-status$/, '-settings'), context).data('verticalTab');
-      // Because the vertical tabs aren't currently working, just work on the
-      // fieldset itself for now.
-      var $fieldset = $('#' + $checkbox.attr('id').replace(/-status$/, '-settings'), context);
+  "use strict";
 
-      // Bind click handler to this checkbox to conditionally show and hide the
-      // filter's tableDrag row and vertical tab pane.
-      $checkbox.bind('click.filterUpdate', function () {
-        if ($checkbox.is(':checked')) {
-          $row.show();
-          $fieldset.show();
-          if (tab) {
-            tab.tabShow().updateSummary();
+  /**
+   * Attach behaviors for the display settings.
+   */
+  Drupal.behaviors.formatterStatusStatus = {
+    attach: function (context, settings) {
+      console.log('ATTACH');
+      $('.fallback-formatter-status-wrapper input.form-checkbox', context).once('fallback-formatter-status', function () {
+        var $checkbox = $(this);
+        var formatterSelector = $checkbox.attr('id').replace(/-status$/, '');
+        console.log(formatterSelector);
+
+        // Retrieve the tabledrag row belonging to this filter.
+        var $row = $('#' + formatterSelector + '-weight', context).closest('tr');
+        // Retrieve the vertical tab belonging to this filter.
+        var tab = $('#' + formatterSelector + '-settings', context).data('verticalTab');
+        // Because the vertical tabs aren't currently working, just work on the
+        // fieldset itself for now.
+        var $fieldset = $('#' + formatterSelector +  '-settings', context);
+
+        // Bind click handler to this checkbox to conditionally show and hide the
+        // filter's tableDrag row and vertical tab pane.
+        $checkbox.bind('click.filterUpdate', function () {
+          if ($checkbox.is(':checked')) {
+            $row.show();
+            $fieldset.show();
+            if (tab) {
+              tab.tabShow().updateSummary();
+            }
           }
-        }
-        else {
-          $row.hide();
-          $fieldset.hide();
-          if (tab) {
-            tab.tabHide().updateSummary();
+          else {
+            $row.hide();
+            $fieldset.hide();
+            if (tab) {
+              tab.tabHide().updateSummary();
+            }
           }
-        }
-        // Restripe table after toggling visibility of table row.
-        Drupal.tableDrag['fallback-formatter-order'].restripeTable();
-      });
-
-      // Attach summary for configurable filters (only for screen-readers).
-      if (tab) {
-        tab.fieldset.drupalSetSummary(function (tabContext) {
-          return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
+          // Restripe table after toggling visibility of table row.
+          Drupal.tableDrag['fallback-formatter-order'].restripeTable();
         });
-      }
 
-      // Trigger our bound click handler to update elements to initial state.
-      $checkbox.triggerHandler('click.filterUpdate');
-    });
-  }
-};
+        // Attach summary for configurable filters (only for screen-readers).
+        if (tab) {
+          tab.fieldset.drupalSetSummary(function (tabContext) {
+            return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
+          });
+        }
 
-})(jQuery);
+        // Trigger our bound click handler to update elements to initial state.
+        $checkbox.triggerHandler('click.filterUpdate');
+      });
+    }
+  };
+
+})(jQuery, Drupal);
diff --git a/fallback_formatter.module b/fallback_formatter.module
index 9d990ed..5225ead 100644
--- a/fallback_formatter.module
+++ b/fallback_formatter.module
@@ -104,74 +104,61 @@ function fallback_formatter_field_formatter_settings_summary($field, $instance,
  * Implements hook_field_formatter_settings_form().
  */
 function fallback_formatter_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
+  $elements = array();
   $display = $instance['display'][$view_mode];
   $settings = $display['settings'];
 
-  $element = array();
-  $formatters = fallback_formatter_get_possible_formatters($field['type']);
+  $formatters = $settings['formatters'];
+  _fallback_formatter_prepare_formatters($field['type'], $formatters, FALSE);
 
-  $element['#attached']['js'][] = drupal_get_path('module', 'fallback_formatter') . '/fallback_formatter.admin.js';
-
-  $weights = array();
-  $current_weight = 0;
-  foreach ($formatters as $name => $formatter) {
-    if (isset($settings['formatters'][$name]['weight'])) {
-      $weights[$name] = $settings['formatters'][$name]['weight'];
-    }
-    elseif (isset($formatter['weight'])) {
-      $weights[$name] = $formatter['weight'];
-    }
-    elseif (empty($settings['formatters'])) {
-      $weights[$name] = $current_weight++;
-    }
-  }
+  $elements['#attached']['js'][] = drupal_get_path('module', 'fallback_formatter') . '/fallback_formatter.admin.js';
 
   $parents = array('fields', $field['field_name'], 'settings_edit_form', 'settings', 'formatters');
 
   // Filter status.
-  $element['formatters']['status'] = array(
+  $elements['formatters']['status'] = array(
     '#type' => 'item',
     '#title' => t('Enabled formatters'),
     '#prefix' => '<div class="fallback-formatter-status-wrapper">',
     '#suffix' => '</div>',
   );
-  foreach ($formatters as $name => $formatter) {
-    $element['formatters']['status'][$name] = array(
+  foreach ($formatters as $name => $options) {
+    $elements['formatters']['status'][$name] = array(
       '#type' => 'checkbox',
-      '#title' => $formatter['label'],
-      '#default_value' => !empty($settings['formatters'][$name]['status']),
+      '#title' => $options['label'],
+      '#default_value' => !empty($options['status']),
       '#parents' => array_merge($parents, array($name, 'status')),
-      '#weight' => $weights[$name],
+      '#weight' => $options['weight'],
     );
   }
 
   // Filter order (tabledrag).
-  $element['formatters']['order'] = array(
+  $elements['formatters']['order'] = array(
     '#type' => 'item',
     '#title' => t('Formatter processing order'),
     '#theme' => 'fallback_formatter_settings_order',
   );
-  foreach ($formatters as $name => $formatter) {
-    $element['formatters']['order'][$name]['label'] = array(
-      '#markup' => $formatter['label'],
+  foreach ($formatters as $name => $options) {
+    $elements['formatters']['order'][$name]['label'] = array(
+      '#markup' => $options['label'],
     );
-    $element['formatters']['order'][$name]['weight'] = array(
+    $elements['formatters']['order'][$name]['weight'] = array(
       '#type' => 'weight',
-      '#title' => t('Weight for @title', array('@title' => $formatter['label'])),
+      '#title' => t('Weight for @title', array('@title' => $options['label'])),
       '#title_display' => 'invisible',
       '#delta' => 50,
-      '#default_value' => $weights[$name],
+      '#default_value' => $options['weight'],
       '#parents' => array_merge($parents, array($name, 'weight')),
     );
-    $element['formatters']['order'][$name]['#weight'] = $weights[$name];
+    $elements['formatters']['order'][$name]['#weight'] = $options['weight'];
   }
 
   // Filter settings.
-  /*$element['formatter_settings_title'] = array(
+  /*$elements['formatter_settings_title'] = array(
     '#type' => 'item',
     '#title' => t('Formatter settings'),
   );
-  $element['formatter_settings'] = array(
+  $elements['formatter_settings'] = array(
     '#type' => 'vertical_tabs',
   );*/
 
@@ -184,19 +171,25 @@ function fallback_formatter_field_formatter_settings_form($field, $instance, $vi
 
       $settings_form = $function($field, $formatter_instance, $view_mode, $form, $form_state);
       if (!empty($settings_form)) {
-        $element['formatters']['settings'][$name] = array(
+        $elements['formatters']['settings'][$name] = array(
           '#type' => 'fieldset',
           '#title' => $formatter['label'],
           '#parents' => array_merge($parents, array($name, 'settings')),
-          '#weight' => $weights[$name],
+          '#weight' => $formatter['weight'],
           '#group' => 'formatter_settings',
         );
-        $element['formatters']['settings'][$name] += $settings_form;
+        $elements['formatters']['settings'][$name] += $settings_form;
       }
     }
+
+    $elements['formatters']['settings'][$name]['formatter'] = array(
+      '#type' => 'value',
+      '#value' => $name,
+      '#parents' => array_merge($parents, array($name, 'formatter')),
+    );
   }
 
-  return $element;
+  return $elements;
 }
 
 /**
@@ -273,33 +266,30 @@ function fallback_formatter_get_possible_formatters($field_type) {
   return $return;
 }
 
-function _fallback_formatter_prepare_formatters($field_type, array &$formatters) {
+function _fallback_formatter_prepare_formatters($field_type, array &$formatters, $filter_enabled = TRUE) {
+  $default_weight = 0;
+
   $allowed_formatters = fallback_formatter_get_possible_formatters($field_type);
+  $formatters += $allowed_formatters;
 
   $formatters = array_intersect_key($formatters, $allowed_formatters);
 
   foreach ($formatters as $formatter => $info) {
     // Remove disabled formatters.
-    if (isset($info['status']) && !$info['status']) {
+    if ($filter_enabled && empty($info['status'])) {
       unset($formatters[$formatter]);
       continue;
     }
 
     // Provide some default values.
-    $formatters[$formatter] += array('type' => $formatter, 'weight' => 0);
+    $formatters[$formatter] += array('type' => $formatter, 'weight' => $default_weight++);
     // Merge in defaults and settigns from hook_field_formatter_info().
     $formatters[$formatter] += $allowed_formatters[$formatter];
     $formatters[$formatter]['settings'] += $allowed_formatters[$formatter]['settings'];
   }
 
   // Sort by weight.
-  uasort($formatters, 'fallback_formatter_sort_formatters');
-}
-
-function fallback_formatter_sort_formatters($a, $b) {
-  $a_weight = (is_array($a) && isset($a['weight'])) ? $a['weight'] : 0;
-  $b_weight = (is_array($b) && isset($b['weight'])) ? $b['weight'] : 0;
-  return ($a_weight < $b_weight) ? -1 : 1;
+  uasort($formatters, 'drupal_sort_weight');
 }
 
 function theme_fallback_formatter_settings_order($variables) {
diff --git a/fallback_formatter.test b/fallback_formatter.test
index edce313..1f6ae03 100644
--- a/fallback_formatter.test
+++ b/fallback_formatter.test
@@ -40,10 +40,15 @@ class FallbackFormatterTestCase extends DrupalWebTestCase {
     $node->test_text[LANGUAGE_NONE][2]['value'] = 'Carrot';
 
     $formatters = array(
-      'fallback_test_a' => array(),
-      'fallback_test_b' => array(),
+      'fallback_test_a' => array(
+        'status' => 1,
+      ),
+      'fallback_test_b' => array(
+        'status' => 1,
+      ),
       'fallback_test_default' => array(
         'settings' => array('prefix' => 'DEFAULT: '),
+        'status' => 1,
       ),
     );
     $expected = array(
@@ -54,10 +59,15 @@ class FallbackFormatterTestCase extends DrupalWebTestCase {
     $this->assertFallbackFormatter('node', $node, 'test_text', $formatters, $expected);
 
     $formatters = array(
-      'fallback_test_a' => array(),
-      'fallback_test_b' => array(),
+      'fallback_test_a' => array(
+        'status' => 1,
+      ),
+      'fallback_test_b' => array(
+        'status' => 1,
+      ),
       'fallback_test_default' => array(
         'settings' => array('prefix' => 'DEFAULT: '),
+        'status' => 1,
         'weight' => -1,
       ),
     );
@@ -70,11 +80,15 @@ class FallbackFormatterTestCase extends DrupalWebTestCase {
 
     $formatters = array(
       'fallback_test_a' => array(
+        'status' => 1,
         'settings' => array('deny' => TRUE),
       ),
-      'fallback_test_b' => array(),
+      'fallback_test_b' => array(
+        'status' => 1,
+      ),
       'fallback_test_default' => array(
         'settings' => array('prefix' => 'DEFAULT: '),
+        'status' => 1,
       ),
     );
     $expected = array(
