diff --git a/facetapi_multiselect.module b/facetapi_multiselect.module
index 229003d..ed8c4f1 100644
--- a/facetapi_multiselect.module
+++ b/facetapi_multiselect.module
@@ -69,6 +69,13 @@ function facetapi_multiselect_form($form, &$form_state, $widget, $element) {
     '#value' => t('Submit'),
   );

+  $build = $widget->getBuild();
+  $settings = $build['#settings']->settings;
+
+  if ($settings['auto_submit']) {
+    $form['#attached']['js'][] = drupal_get_path('module', 'facetapi_multiselect') . '/js/facetapi_multiselect_autosubmit.js';
+  }
+
   return $form;
 }

diff --git a/js/facetapi_multiselect_autosubmit.js b/js/facetapi_multiselect_autosubmit.js
new file mode 100644
index 0000000..8425e0a
--- /dev/null
+++ b/js/facetapi_multiselect_autosubmit.js
@@ -0,0 +1,10 @@
+(function($){
+  Drupal.behaviors.facetapi_multiselect = {
+    attach: function (context, settings) {
+      $('form[id^="facetapi-multiselect-form"] .form-submit', context).hide();
+      $('form[id^="facetapi-multiselect-form"] select', context).change(function () {
+        $(this).closest('form').submit();
+      });
+    }
+  };
+})(jQuery);

diff --git a/plugins/facetapi/facetapi_multiselect.inc b/plugins/facetapi/facetapi_multiselect.inc
index 55e6c12..a9c0458 100644
--- a/plugins/facetapi/facetapi_multiselect.inc
+++ b/plugins/facetapi/facetapi_multiselect.inc
@@ -26,17 +26,33 @@ class FacetapiMultiSelectWidget extends FacetapiWidgetLinks {
   /**
    * Builds an array of #options for our select element.
    */
-  public function buildOptions($element) {
-    $options = array();
+  public function buildOptions($element, $options = array(), $depth = 0) {
+    $settings = $this->settings->settings;
     foreach ($element as $item) {
-      if (empty($item['#item_children'])) {
+      if (empty($item['#item_children']) || !$settings['optgroups']) {
         $key = $this->getOptionKey($item);
-        $options[$key] = $item['#markup'];
+        $options[$key] = $settings['add_count'] ? $item['#markup'] . ' (' . $item['#count'] . ')' : $item['#markup'];
+        // Prepend the text with a depth indicator.
+        if ($depth > 0) {
+          $options[$key] = str_repeat('-', $depth) . ' ' . $options[$key];
+        }
+        // If the current item is active, but if we have selected the "Remove
+        // selected" option, remove this items from our array, since we want to
+        // hide it.
+        if ($item['#active'] && $settings['remove_selected']) {
+          unset($options[$key]);
+        }
       }
-      else {
-        // Recursively add any children of the item to the #options array (this
-        // will result in them being placed inside optgroups).
-        $options[$item['#markup']] = $this->buildOptions($item['#item_children']);
+      if ($item['#item_children']) {
+        if ($settings['optgroups']) {
+          // Recursively add any children of the item to the #options array (this
+          // will result in them being placed inside optgroups).
+          $options[$item['#markup']] = $this->buildOptions($item['#item_children']);
+        }
+        else {
+          // Not using optgroups, so put all items at the root level.
+          $options = $options + $this->buildOptions($item['#item_children'], $options, $depth + 1);
+        }
       }
     }
     return $options;
@@ -46,28 +62,100 @@ class FacetapiMultiSelectWidget extends FacetapiWidgetLinks {
    * Builds a #default_value array for our select element.
    */
   public function buildDefaultValue($element) {
-    $default_value = array();
-    foreach ($element as $item) {
-      if ($item['#active']) {
-        $default_value[] = $this->getOptionKey($item);
-        // If the item has children, add their default values to the array
-        // also.
-        if (!empty($item['#item_children'])) {
-          $default_value = array_merge($default_value, $this->buildDefaultValue($item['#item_children']));
-        }
-      }
+    $active_items = $this->facet->getAdapter()->getActiveItems($this->facet->getFacet());
+    foreach($active_items as $id=>$values) {
+      $default_value[] = $values['field alias'] . ":" . $id;
     }
     return $default_value;
   }

+
   /**
    * Gets the key to use for an item in the select element #options array.
    */
   protected function getOptionKey($item) {
+    $settings = $this->settings->settings;
+    if ($settings['act_single'] && isset($item['#query']['f'])) {
+      return implode('&', $item['#query']['f']);
+    }
     // Set the key to the filter that will appear in the URL if this item is
     // selected. We need to do it this way (rather than using $item['#query'])
     // so that multiple selections can be combined together in the form's
     // submit handler.
     return $this->facet['field alias'] . ':' . $item['#indexed_value'];
   }
+
+  /**
+   * Allows the widget to provide additional settings to the form.
+   */
+  function settingsForm(&$form, &$form_state) {
+    $form['widget']['widget_settings']['links'][$this->id]['add_count'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Add count'),
+      '#description' => t('Add available item count in brackets.'),
+      '#default_value' => $this->settings->settings['add_count'],
+      '#states' => array(
+        'visible' => array(
+          'select[name="widget"]' => array('value' => $this->id),
+        ),
+      ),
+    );
+    $form['widget']['widget_settings']['links'][$this->id]['remove_selected'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Remove selected'),
+      '#description' => t('Remove selected options from select list.'),
+      '#default_value' => $this->settings->settings['remove_selected'],
+      '#states' => array(
+        'visible' => array(
+          'select[name="widget"]' => array('value' => $this->id),
+        ),
+      ),
+    );
+    $form['widget']['widget_settings']['links'][$this->id]['auto_submit'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Autosubmit'),
+      '#description' => t('Hide submit button and submit selection automatically.'),
+      '#default_value' => $this->settings->settings['auto_submit'],
+      '#states' => array(
+        'visible' => array(
+          'select[name="widget"]' => array('value' => $this->id),
+        ),
+      ),
+    );
+    $form['widget']['widget_settings']['links'][$this->id]['act_single'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Act as single select element'),
+      '#description' => t('Change query path to work with facets from connected fields.'),
+      '#default_value' => $this->settings->settings['act_single'],
+      '#states' => array(
+        'visible' => array(
+          'select[name="widget"]' => array('value' => $this->id),
+        ),
+      ),
+    );
+    $form['widget']['widget_settings']['links'][$this->id]['optgroups'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Nest hierarchical facets in optgroups.'),
+      '#description' => t('Parent facets will be rendered as optgroups in the select element.'),
+      '#default_value' => $this->settings->settings['optgroups'],
+      '#states' => array(
+        'visible' => array(
+          'select[name="widget"]' => array('value' => $this->id),
+        ),
+      ),
+    );
+  }
+
+  /**
+   * Returns defaults for the settings this widget provides.
+   */
+  function getDefaultSettings() {
+    return array(
+      'add_count' => 0,
+      'remove_selected' => 0,
+      'auto_submit' => 0,
+      'act_single' => 0,
+      'optgroups' => 1,
+    );
+  }
 }
