diff --git a/ajax_facets.module b/ajax_facets.module
index 814fc70..f0f87d3 100755
--- a/ajax_facets.module
+++ b/ajax_facets.module
@@ -56,21 +56,52 @@ function ajax_facets_facetapi_widgets() {
 function ajax_facets_add_ajax_checkboxes_js($facet) {
   static $included = FALSE;
   if (!$included) {
-    $included = TRUE;
-    drupal_add_library('system', 'ui.draggable');
+
+    // Add necessary libraries and css/js
     $module_path = drupal_get_path('module', 'ajax_facets');
+    drupal_add_library('system', 'ui.draggable');
     drupal_add_js($module_path . '/js/ajax_facets.js');
     drupal_add_js($module_path . '/js/jquery.mousewheel.min.js');
     drupal_add_js($module_path . '/js/jquery.mCustomScrollbar.js');
     drupal_add_css($module_path . '/css/jquery.mCustomScrollbar.css');
+
+    // Some variables to get us going
+    $included = TRUE;
     $search_path = $facet->getAdapter()->getSearchPath();
     $filter_key = $facet->getAdapter()->getUrlProcessor()->getFilterKey();
-    // Note that we add in query only filter params and exclude pages and etc...
-    $query = (isset($_GET[$filter_key])) ? array($filter_key => $_GET[$filter_key]) : array();
+    $query = array();
+    $default_query = array();
     $views = search_api_current_search();
     $view_name = '';
     $display_name = '';
 
+    // For pretty paths we have to
+    if (ajax_facets_pretty_paths_enabled($facet->getAdapter()->getSearcher())) {
+      $enabled_facets = $facet->getAdapter()->getEnabledFacets();
+      $url_processor = $facet->getAdapter()->getUrlProcessor();
+      $pretty_path = str_replace($url_processor->getBasePath(), '', $_GET['q']);
+      $args = explode('/', $pretty_path);
+      foreach ($enabled_facets as $enabled_facet) {
+        $pretty_paths_alias = $url_processor->getFacetPrettyPathsAlias($enabled_facet);
+        // Loop through the path parts
+        for ($i = 1; $i < count($args); $i++) {
+          // If the current path part is the path alias
+          if ($args[$i] == $pretty_paths_alias) {
+            // Steal the pretty path segment
+            $default_query[] = '/' . $args[$i] . '/' . $args[$i + 1];
+            unset($args[$i]);
+            unset($args[++$i]);
+          }
+        }
+      }
+      $apply_path = url($search_path);
+    }
+    else {
+      // Note that we add in query only filter params and exclude pages and etc...
+      $query = (isset($_GET[$filter_key])) ? array($filter_key => $_GET[$filter_key]) : array();
+      $apply_path = url($search_path, array('query' => $query));
+    }
+
     if (!empty($views)) {
       // Get display from settings.
       $facet_settings = $facet->getSettings();
@@ -89,17 +120,19 @@ function ajax_facets_add_ajax_checkboxes_js($facet) {
       }
     }
 
-    $facet = $facet->getFacet();
+    $facet_info = $facet->getFacet();
     $setting['facetapi'] = array(
-      'defaultQuery' => isset($_GET[$filter_key]) ? $_GET[$filter_key] : '',
+      'defaultQuery' => $default_query,
       'searchPath' => $search_path,
-      'index_id' => $facet['map options']['index id'],
+      'index_id' => $facet_info['map options']['index id'],
       'view_name' => $view_name,
       'display_name' => $display_name,
-      'facet_field' => $facet['map options']['field']['key'],
+      'facet_field' => $facet_info['map options']['field']['key'],
       'searchKeys' => isset($_GET['search_api_views_fulltext']) ? $_GET['search_api_views_fulltext'] : '',
-      'applyPath' => url($search_path, array('query' => $query)),
+      'applyPath' => $apply_path,
+      'prettyPaths' => ajax_facets_pretty_paths_enabled($facet->getAdapter()->getSearcher()),
     );
+
     drupal_add_js($setting, 'setting');
   }
 }
@@ -111,25 +144,57 @@ function ajax_facets_facet_build_reset_path($facet, $adapter) {
   $params = $adapter->getUrlProcessor()->fetchParams();
   $filter_key = $adapter->getUrlProcessor()->getFilterKey();
   $clean_params = array();
-  // Build query params except current facet filters.
-  foreach ($params[$filter_key] as $param) {
-    if (strpos($param, $facet['name']) !== 0) {
-      $clean_params[] = $param;
-    }
-  }
   $url_params = array();
-  if (!empty($clean_params)) {
-    $url_params = array('query' => array($filter_key => $clean_params));
+
+  // Special Handling for pretty paths
+  if (ajax_facets_pretty_paths_enabled($adapter->getSearcher())) {
+    // Create the processor
+    $processor = new FacetapiUrlProcessorPrettyPaths($adapter);
+    // Pull the pretty path alias
+    $pretty_paths_alias = $processor->getFacetPrettyPathsAlias($facet);
+    // Explode the path
+    $path = explode('/', str_replace('ajax/ajax_facets/refresh/', '', $_GET['q']));
+    // Loop through the path parts
+    for ($i = 0; $i < count($path); $i++) {
+      // If the current path part is the path alias
+      if ($path[$i] == $pretty_paths_alias) {
+        // We unset this part and the next one
+        unset($path[$i]);
+        unset($path[++$i]);
+      }
+    }
+    // Rebuild the path without the current filters
+    $path = implode('/', $path);
+    // Don't need this if it happens to be set since our paths are pretty
+    unset($params[$filter_key]);
+    // Keep the rest of the url params since they might do other things
+    $url_params = $params;
   }
+  else {
+    // Build query params except current facet filters.
+    if (!empty($params[$filter_key])) {
+      foreach ($params[$filter_key] as $param) {
+        if (strpos($param, $facet['name']) !== 0) {
+          $clean_params[] = $param;
+        }
+      }
 
-  $unset_keys = array('searchPath', 'q', 'page', $filter_key);
-  // Remove default params from redirect.
-  foreach ($params as $key => $value) {
-    if (!in_array($key, $unset_keys)) {
-      $url_params['query'][$key] = $value;
+      if (!empty($clean_params)) {
+        $url_params = array('query' => array($filter_key => $clean_params));
+      }
+
+      $unset_keys = array('searchPath', 'q', 'page', $filter_key);
+      // Remove default params from redirect.
+      foreach ($params as $key => $value) {
+        if (!in_array($key, $unset_keys)) {
+          $url_params['query'][$key] = $value;
+        }
+      }
     }
+    $path = (!empty($_GET['searchPath']) ? $_GET['searchPath'] : $adapter->getSearchPath());
   }
-  return url((!empty($_GET['searchPath']) ? $_GET['searchPath'] : $adapter->getSearchPath()), $url_params);
+
+  return url($path, $url_params);
 }
 
 /**
@@ -144,13 +209,21 @@ function ajax_facets_facet_build_apply_path($adapter) {
       unset($params[$key]);
     }
   }
-  // Remove empty filter key.
+
   $filter_key = $adapter->getUrlProcessor()->getFilterKey();
-  if (isset($params[$filter_key]) && empty($params[$filter_key])) {
+  if (ajax_facets_pretty_paths_enabled($adapter->getSearcher())) {
     unset($params[$filter_key]);
+    $path = $_GET['q'];
+  }
+  else {
+    // Remove empty filter key.
+    if (isset($params[$filter_key]) && empty($params[$filter_key])) {
+      unset($params[$filter_key]);
+    }
+    $path = (!empty($_GET['searchPath']) ? $_GET['searchPath'] : $adapter->getSearchPath());
   }
   $url_params = !empty($params) ? array('query' => $params) : array();
-  return url((!empty($_GET['searchPath']) ? $_GET['searchPath'] : $adapter->getSearchPath()), $url_params);
+  return url($path, $url_params);
 }
 
 /**
@@ -164,3 +237,128 @@ function ajax_facets_ajax_deliver($page_callback_result) {
   // Perform end-of-request tasks.
   ajax_footer();
 }
+
+/**
+ * Implementation of hook_views_ajax_data_alter()
+ */
+function ajax_facets_views_ajax_data_alter(&$commands, $view) {
+  // As long as we're on a search api index view
+  if (strpos($view->base_table, 'search_api_index') !== FALSE) {
+    // We can get the index ID from the view base table
+    $index_id = str_replace('search_api_index_', '', $view->base_table);
+    // Create the searcher name
+    $searcher = 'search_api@' . $index_id;
+    // Get our facet blocks
+    $blocks = ajax_facets_process_facet_blocks($searcher);
+    // Create commands to replace each block
+    foreach ($blocks['facet_blocks'] as $class => $content) {
+      $commands[] = ajax_command_replace('.' . $class, $content);
+    }
+    // Show all blocks
+    $commands[] = ajax_command_invoke('div.block-facetapi:not(:visible)', 'show');
+    // Hide empty blocks
+    foreach ($blocks['hide_blocks'] as $block_id) {
+      $commands[] = ajax_command_invoke('#' . $block_id, 'hide');
+    }
+    // Update the views ajax path with the facet query so that exposed filter
+    // page requests knows which facets are enabled
+    if ($facet_query) {
+      // For pretty paths we just return the current path
+      if (ajax_facets_pretty_paths_enabled($searcher)) {
+        $ajax_path = $_GET['q'];
+      }
+      else {
+        // For regular facetapi paths we have to add the f query variable
+        $facet_query = !empty($_GET['f']) ? $_GET['f'] : '';
+        $ajax_path = url('views/ajax', array('query' => array('f' => $facet_query)));
+      }
+      // Override the views ajax_path setting...
+      $settings = array(
+        'views' => array(
+          'ajax_path' => $ajax_path,
+        ),
+      );
+      // We need to put this at the head of the commands so that it runs before
+      // the views commands. This is because ajax_render() in ajax.inc prepends
+      // it's own settings command to the commands array which will change
+      // views ajax_path back to views/ajax. If we don't fix this before views
+      // runs it's ajax commands, the views ajax event won't get the facets in
+      // the path and they'll be reset on exposed filter input.
+      array_unshift($commands, ajax_command_settings($settings, TRUE));
+    }
+  }
+}
+
+/**
+ * Generates an array of facet block data for a given searcher and realm
+ *
+ * @param  string $searcher
+ *         The machine name of the searcher.
+ *
+ * @param  string $realm_name
+ *         The machine name of the realm
+ *
+ * @return array
+ *         An array of facet block data
+ */
+function ajax_facets_process_facet_blocks($searcher, $realm_name = 'block') {
+
+  $map = facetapi_get_delta_map();
+  $facets_to_proceed = array();
+  $enabled_facets = facetapi_get_enabled_facets($searcher, $realm_name);
+  foreach ($enabled_facets as $facet) {
+    $facets_to_proceed[] = $facet['name'];
+  }
+
+  // Our return array
+  $blocks = array(
+    'facet_blocks' => array(),
+    'hide_blocks' => array(),
+    'reset_urls' => array(),
+    'active_items' => array(),
+  );
+
+  $group = $searcher . ':' . $realm_name;
+  // Process values once per searcher-realm group.
+  $adapter = facetapi_adapter_load($searcher);
+  $builds[$group] = ($adapter) ? $adapter->buildRealm($realm_name) : array();
+  foreach ($facets_to_proceed as $facet_name) {
+    $facet = $adapter->getFacet(array('name' => $facet_name));
+    $blocks['reset_urls'][$facet_name] = ajax_facets_facet_build_reset_path(facetapi_facet_load($facet_name, $searcher), $adapter);
+    if (!empty($builds[$group][$facet_name])) {
+      $build = $facet->getBuild();
+      $blocks['active_items'][$facet_name] = array();
+      foreach ($build as $key => $value) {
+        if ($value['#active']) {
+          $blocks['active_items'][$facet_name][] = "$facet_name:$key";
+        }
+      }
+      if (!empty($blocks['active_items'][$facet_name])) {
+        sort($blocks['active_items'][$facet_name]);
+      }
+
+      // Skip currently checked facet - we will not refresh them.
+      $blocks['facet_blocks'][$builds[$group][$facet_name]['#attributes']['id']] = drupal_render($builds[$group][$facet_name]);
+    }
+    else {
+      $facet_name = urlencode($facet_name);
+      $delta = array_search("$searcher:$realm_name:$facet_name", $map);
+      $blocks['hide_blocks'][] = 'block-facetapi-' . strtolower($delta);
+    }
+  }
+
+  return $blocks;
+}
+
+/**
+ * Helper function to check if facet_api_pretty_paths is enabled
+ *
+ * @param  string $searcher
+ *         The machine name of the searcher
+ *
+ * @return boolean
+ *         TRUE or FALSE if pretty paths is enabled or not
+ */
+function ajax_facets_pretty_paths_enabled($searcher) {
+  return (module_exists('facetapi_pretty_paths') && variable_get('facetapi_pretty_paths_searcher_' . $searcher, 0));
+}
diff --git a/ajax_facets.pages.inc b/ajax_facets.pages.inc
index d9caf2d..c7f365f 100755
--- a/ajax_facets.pages.inc
+++ b/ajax_facets.pages.inc
@@ -17,66 +17,36 @@ function ajax_facets_refresh_facets_content() {
   $view->execute_display($display_id, array());
   $page = $view->preview($display_id);
 
-  $map = facetapi_get_delta_map();
-  $realm_name = 'block';
   $searcher = 'search_api@' . $_GET['index_id'];
-  $facets_to_proceed = array();
-  $enabled_facets = facetapi_get_enabled_facets($searcher, $realm_name);
-  foreach ($enabled_facets as $facet) {
-    $facets_to_proceed[] = $facet['name'];
-  }
-  $facet_blocks = array();
-  $reset_urls = array();
-  $hide_blocks = array();
-  $active_items = array();
-
-  $group = $searcher . ':' . $realm_name;
-  // Process values once per searcher-realm group.
   $adapter = facetapi_adapter_load($searcher);
-  $builds[$group] = ($adapter) ? $adapter->buildRealm($realm_name) : array();
-  foreach ($facets_to_proceed as $facet_name) {
-    $facet = $adapter->getFacet(array('name' => $facet_name));
-    $reset_urls[$facet_name] = ajax_facets_facet_build_reset_path($facet, $adapter);
-    if (!empty($builds[$group][$facet_name])) {
-      $build = $facet->getBuild();
-      $active_items[$facet_name] = array();
-      foreach ($build as $key => $value) {
-        if ($value['#active']) {
-          $active_items[$facet_name][] = "$facet_name:$key";
-        }
-      }
-      if (!empty($active_items[$facet_name])) {
-        sort($active_items[$facet_name]);
-      }
-
-      // Skip currently checked facet - we will not refresh them.
-      $facet_blocks[$builds[$group][$facet_name]['#attributes']['id']] = drupal_render($builds[$group][$facet_name]);
-    }
-    else {
-      $facet_name = urlencode($facet_name);
-      $delta = array_search("$searcher:$realm_name:$facet_name", $map);
-      $hide_blocks[] = 'block-facetapi-' . strtolower($delta);
-    }
-  }
+  $blocks = ajax_facets_process_facet_blocks($searcher);
+  $facet_query = !empty($_GET['f']) ? $_GET['f'] : '';
 
   $result = array(
     'applyUrl' => ajax_facets_facet_build_apply_path($adapter),
-    'resetUrls' => $reset_urls,
-    'newContent' => $facet_blocks,
-    'hideBlocks' => $hide_blocks,
-    'activeItems' => $active_items,
+    'resetUrls' => $blocks['reset_urls'],
+    'newContent' => $blocks['facet_blocks'],
+    'hideBlocks' => $blocks['hide_blocks'],
+    'activeItems' => $blocks['active_items'],
     'views_content' => $page,
     'display_id' => $display_id,
     'views_name' => $name,
-    'facets' => !empty($_GET['f']) ? $_GET['f'] : '',
+    'facets' => $facet_query,
   );
 
+  if (ajax_facets_pretty_paths_enabled($searcher)) {
+    $ajax_path = url('views/ajax' . implode('', $facet_query));
+  }
+  else {
+    $ajax_path = url('views/ajax', array('query' => array('f' => $facet_query)));
+  }
+
   // @see template_preprocess_views_view();
   // Update settings when view will be reloaded. Specifically $view->dom_id.
   if ($view->use_ajax) {
     $result['settings'] = array(
       'views' => array(
-        'ajax_path' => url('views/ajax'),
+        'ajax_path' => $ajax_path,
         'ajaxViews' => array(
           'views_dom_id:' . $view->dom_id => array(
             'view_name' => $view->name,
diff --git a/js/ajax_facets.js b/js/ajax_facets.js
index 464e413..014dc03 100755
--- a/js/ajax_facets.js
+++ b/js/ajax_facets.js
@@ -37,7 +37,6 @@
         else {
           Drupal.ajax_facets.queryState = {'f':[]};
         }
-        // We will send original search path to server to get back proper reset links.
         if (settings.facetapi.searchPath != undefined) {
           Drupal.ajax_facets.queryState['searchPath'] = settings.facetapi.searchPath;
         }
@@ -88,6 +87,7 @@
           }
         });
       }
+
     }
   };
 
@@ -183,7 +183,12 @@
 
     var $this = $(this);
     var facetOptions = event.data[0];
-    var name = $this.attr('name') + ':';
+    if (Drupal.settings.facetapi.prettyPaths) {
+      var name = '/' + $this.attr('name');
+    }
+    else {
+      var name = $this.attr('name') + ':';
+    }
     // Show loader on request start.
     $('div.block-facetapi div.loader').show();
 
@@ -201,7 +206,7 @@
         delete Drupal.ajax_facets.queryState['f'][Drupal.ajax_facets.queryState['f'].length];
       }
       else {
-        Drupal.ajax_facets.queryState['f'][Drupal.ajax_facets.queryState['f'].length] = name + $this.find(":selected").val();
+        Drupal.ajax_facets.queryState['f'][Drupal.ajax_facets.queryState['f'].length] = $this.find(":selected").val();
       }
     }
 
@@ -215,6 +220,7 @@
     var $this = $(this);
     var facetOptions = event.data[0];
     var facetCheckboxName = $this.attr('name');
+
     // Show loader on request start.
     $('div.block-facetapi div.loader').show();
 
@@ -251,16 +257,38 @@
     // Deny any filtering during refresh.
     Drupal.ajax_facets.applyFlag = false;
     Drupal.ajax_facets.beforeAjax();
+    // The data for our get request
+    var data = Drupal.ajax_facets.queryState;
+    // The base url for the ajax request
+    var url = encodeURI(Drupal.settings.basePath + 'ajax/ajax_facets/refresh');
+    // Custom handling of facets for pretty paths. Technically we're still
+    // sending the get variable 'f' but it will be ignored by the pretty path
+    // url processor
+    if (Drupal.settings.facetapi.prettyPaths && data.f != undefined) {
+      url += data.f.join('');
+    }
+    // Render the exposed filter data to send along with the ajax request
+    var exposedFormId = '#views-exposed-form-' + Drupal.ajax_facets.queryState['view_name'] + '-' + Drupal.ajax_facets.queryState['display_name'];
+    $.each($(exposedFormId).serializeArray(), function(index, value) {
+      data[value.name] = value.value;
+    });
+    console.log(url);
     $.ajax({
       type: 'GET',
-      url: encodeURI(Drupal.settings.basePath + 'ajax/ajax_facets/refresh/'),
+      url: url,
       dataType: 'json',
       // We copy all params to force search query with proper arguments.
-      data: Drupal.ajax_facets.queryState,
+      data: data,
       success: function (response) {
+        console.log(response);
         if (response.activeItems != undefined) {
           Drupal.ajax_facets.facetQueryState = response.activeItems;
         }
+
+        if (response.facets != undefined) {
+          Drupal.ajax_facets.queryState['f'] = response.facets;
+        }
+
         // After Ajax success we should update reset, apply link to handle proper redirects.
         if (response.resetUrls != undefined && Drupal.settings.facetapi.facets != undefined) {
           for (index in Drupal.settings.facetapi.facets) {
@@ -280,7 +308,7 @@
 
         if (response.newContent != undefined && response.newContent) {
           for (var class_name in response.newContent) {
-            var $blockToReplace = $('.' + class_name).parent();
+            var $blockToReplace = $('.' + class_name);//.parent();
             if ($blockToReplace.size()) {
               $blockToReplace.replaceWith(response.newContent[class_name]);
             }
@@ -291,6 +319,7 @@
           }
         }
         $('.view-id-' + response.views_name + '.view-display-id-' + response.display_id).replaceWith(response.views_content);
+
         // As some blocks could be empty in results of filtering - hide them.
         if (response.hideBlocks != undefined && response.hideBlocks) {
           for (var id in response.hideBlocks) {
@@ -303,7 +332,7 @@
 
         if (response.settings.views != undefined) {
           Drupal.settings.views = response.settings.views;
-          Drupal.attachBehaviors($('#block-system-main'));
+          Drupal.attachBehaviors();
         }
 
         // Hide loader on request success.
diff --git a/plugins/facetapi/ajax_widget_checkboxes.inc b/plugins/facetapi/ajax_widget_checkboxes.inc
index fd5523f..fc5a5da 100755
--- a/plugins/facetapi/ajax_widget_checkboxes.inc
+++ b/plugins/facetapi/ajax_widget_checkboxes.inc
@@ -96,9 +96,24 @@ class FacetapiAjaxWidgetCheckboxes extends FacetapiWidgetCheckboxLinks {
         $active_items[] = $this->key . ':' . $item['#markup'];
       }
 
+      if (ajax_facets_pretty_paths_enabled($this->settings->searcher)) {
+        // Get the adapter
+        $adapter = $this->facet->getAdapter();
+        // Get the facet array
+        $facet = $this->facet->getFacet();
+        // Create a fresh processor. This will render our facet paths clean
+        // without any path prefix
+        $processor = new FacetapiUrlProcessorPrettyPaths($adapter);
+        // Pull the pretty path
+        $name = $processor->getFacetPath($facet, array($value), FALSE);
+      }
+      else {
+        $name = urlencode($this->key) . ':' . $value;
+      }
+
       $checkbox = array(
         '#id' => 'facet-checkboxes-' . str_replace(array('_', ' '), '-', $this->key) . '-' . $value,
-        '#name' => urlencode($this->key) . ':' . $value,
+        '#name' => $name,
         '#type' => 'checkbox',
         '#title' => $item['#markup'] . '(' . $item['#count'] . ')',
         '#attributes' => $attributes,
@@ -150,9 +165,7 @@ class FacetapiAjaxWidgetCheckboxes extends FacetapiWidgetCheckboxLinks {
     );
 
     $element = array(
-      '#markup' => '<div class="facet-wrapper-selectbox">'
-        . '<div class="' . $this->build['#attributes']['id'] . '">' . render($item_list) . '</div>'
-        . '</div>'
+      '#markup' => '<div class="facet-wrapper-checkboxes ' . $this->build['#attributes']['id'] . '">' . render($item_list) . '</div>'
     );
   }
 }
diff --git a/plugins/facetapi/ajax_widget_select.inc b/plugins/facetapi/ajax_widget_select.inc
index 8f57e1c..43ffe94 100755
--- a/plugins/facetapi/ajax_widget_select.inc
+++ b/plugins/facetapi/ajax_widget_select.inc
@@ -63,12 +63,24 @@ class FacetapiAjaxWidgetSelect extends FacetapiWidgetCheckboxLinks {
     $items['values'][0] = t('Select');
 
     foreach ($build as $value => $item) {
+
+      if (ajax_facets_pretty_paths_enabled($this->settings->searcher)) {
+        // Create a fresh processor. This will render our facet paths clean
+        // without any path prefix
+        $processor = new FacetapiUrlProcessorPrettyPaths($this->facet->getAdapter());
+        // Pull the pretty path
+        $key = $processor->getFacetPath($this->facet->getFacet(), array($value), FALSE);
+      }
+      else {
+        $key = urlencode($this->key) . ':' . $value;
+      }
+
       // Respect current selection.
       if ($item['#active']) {
-        $items['active_value'] = $value;
+        $items['active_value'] = $key;
       }
 
-      $items['values'][$item['#indexed_value']] = $item['#indexed_value'];
+      $items['values'][$key] = $item['#markup'];
     }
 
     return $items;
@@ -94,11 +106,21 @@ class FacetapiAjaxWidgetSelect extends FacetapiWidgetCheckboxLinks {
       $items['name'] = $facet['label'];
     }
 
+    if (ajax_facets_pretty_paths_enabled($this->settings->searcher)) {
+      // Create the processor
+      $processor = new FacetapiUrlProcessorPrettyPaths($this->facet->getAdapter());
+      // Pull the pretty path alias
+      $name = $processor->getFacetPrettyPathsAlias($this->facet->getFacet());
+    }
+    else {
+      $name = urlencode($this->settings->facet);
+    }
+
     $select = array(
       '#type' => 'select',
       '#title' => $this->build['#title'],
       '#options' => $items['values'],
-      '#name' => urlencode($this->settings->facet),
+      '#name' => $name,
       '#attributes' => array(
         'data-facet' => urlencode($this->settings->facet),
       ),
@@ -109,9 +131,7 @@ class FacetapiAjaxWidgetSelect extends FacetapiWidgetCheckboxLinks {
     }
 
     $element = array(
-      '#markup' => '<div class="facet-wrapper-selectbox">'
-        . '<div class="' . $this->build['#attributes']['id'] . '">' . render($select) . '</div>'
-        . '</div>'
+      '#markup' => '<div class="facet-wrapper-selectbox ' . $this->build['#attributes']['id'] . '">' . render($select) . '</div>'
     );
   }
 }
