diff --git a/Solr_Base_Query.php b/Solr_Base_Query.php
index 0eecc08..95373d6 100644
--- a/Solr_Base_Query.php
+++ b/Solr_Base_Query.php
@@ -278,7 +278,7 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
   protected $solrsort = array('#name' => 'score', '#direction' => 'desc');
   // A flag to allow the search to be aborted.
   public $abort_search = FALSE;
-
+
   // A flag to check if need to retrieve another page of the result set
   public $page = 0;

@@ -576,7 +576,11 @@ class SolrBaseQuery extends SolrFilterSubQuery implements DrupalSolrQueryInterfa
       return $this->base_path . '/' . $this->getParam('q');
     }
     else {
-      return $this->base_path;
+      // Return with empty query (the slash). The path for a facet
+      // becomes $this->base_path . '//facetinfo';
+      // We do this so we can have a consistent way of retrieving the query +
+      // additional parameters
+      return $this->base_path . '/';
     }
   }

diff --git a/apachesolr.module b/apachesolr.module
index 1974c11..17d872a 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -215,6 +215,18 @@ function apachesolr_menu() {
     'type'               => MENU_CALLBACK,
   );

+  // securing the path
+  if (module_exists('devel')) {
+    $items['node/%node/devel/apachesolr'] = array(
+      'title'            => 'Apache Solr',
+      'page callback'    => 'apachesolr_devel',
+      'page arguments'   => array(1),
+      'access arguments' => array('access devel information'),
+      'file'             => 'apachesolr.admin.inc',
+      'type'             => MENU_LOCAL_TASK,
+    );
+  }
+
   // We handle our own menu paths for facets
   if (module_exists('facetapi')) {
     $file_path = drupal_get_path('module', 'facetapi');
@@ -518,7 +530,7 @@ function apachesolr_failure($search_name, $querystring) {
       // If we're failing over to another module make sure the search is available.
       if (module_exists('search')) {
           drupal_set_message(t("%search_name is not available. Your search is being redirected.", array('%search_name' => $search_name)));
-          drupal_goto('search/node/' . drupal_encode_path($querystring));
+          drupal_goto('search/node/' . rawurlencode($querystring));
       }
       // if search is not enabled, break and do nothing
       break;
diff --git a/apachesolr_search.module b/apachesolr_search.module
index f2097b2..837fec1 100644
--- a/apachesolr_search.module
+++ b/apachesolr_search.module
@@ -164,7 +164,8 @@ function apachesolr_search_menu_alter(&$items) {
       'file path' => drupal_get_path('module', 'apachesolr_search'),
     );

-    $items[$search_page->search_path . '/%menu_tail'] = array(
+    // Not using menu tail because of inflexibility with clean urls
+    $items[$search_page->search_path . '/%'] = array(
       'title' => $page_title,
       'load arguments' => array('%map', '%index'),
       'page callback' => 'apachesolr_search_custom_page',
@@ -183,8 +184,8 @@ function apachesolr_search_menu_alter(&$items) {
       $title_callback = $search_type['title callback'];
       $items[$search_page->search_path]['title callback'] = $title_callback;
       $items[$search_page->search_path]['title arguments'] = array($search_page->page_id, $position);
-      $items[$search_page->search_path . '/%menu_tail']['title callback'] = $title_callback;
-      $items[$search_page->search_path . '/%menu_tail']['title arguments'] = array($search_page->page_id, $position);
+      $items[$search_page->search_path . '/%']['title callback'] = $title_callback;
+      $items[$search_page->search_path . '/%']['title arguments'] = array($search_page->page_id, $position);
     }
     // If we have additional searches in the search/* path
     /*if ($core_search) {
@@ -691,6 +692,10 @@ function apachesolr_search_form_search_block_form_alter(&$form, &$form_state) {
     return;
   }

+  if (variable_get('search_default_module') == 'apachesolr_search') {
+    $form['#submit'][] = 'apachesolr_search_form_search_submit';
+  }
+
   if (!empty($search_pages[$redirect_to])) {
     $form['#action'] = url($search_pages[$redirect_to]['search_path']);
     if (!isset($form['#submit'])) {
@@ -1473,7 +1478,6 @@ function apachesolr_search_apachesolr_environment_delete($server) {
   }
 }

-
 /**
  * Implements hook_form_[form_id]_alter().
  *
@@ -1536,11 +1540,20 @@ function theme_apachesolr_search_suggestions($variables) {
  */
 function apachesolr_search_form_search_submit($form, &$form_state) {
   $fv = $form_state['values'];
-  $get = json_decode($fv['apachesolr_search']['get'], TRUE);
-  if (!empty($fv['apachesolr_search']['retain-filters'])) {
-    $get['retain-filters'] = '1';
-    // Add the query values into the redirect.
-    $form_state['redirect'] = array($form_state['redirect'], array('query' => $get));
+
+  if (isset($fv['apachesolr_search'])) {
+    $get = json_decode($fv['apachesolr_search']['get'], TRUE);
+    if (!empty($fv['apachesolr_search']['retain-filters'])) {
+      $get['retain-filters'] = '1';
+      // Add the query values into the redirect.
+      $form_state['redirect'] = array($form_state['redirect'], array('query' => $get));
+    }
+  }
+
+  // Replace keys with their rawurldecoded value
+  if (isset($fv['search_block_form'])) {
+    $raw_keys = rawurlencode($fv['search_block_form']);
+    $form_state['redirect'] = str_replace($fv['search_block_form'], $raw_keys, $form_state['redirect']);
   }
 }

diff --git a/apachesolr_search.pages.inc b/apachesolr_search.pages.inc
index ee19e9f..626e3fc 100644
--- a/apachesolr_search.pages.inc
+++ b/apachesolr_search.pages.inc
@@ -22,6 +22,9 @@ function apachesolr_search_custom_page($page_id, $keys = '', $path_replacer = NU
   $search_page->search_path = str_replace('%', $path_replacer, $search_page->search_path);
   // Retrieve the conditions that apply to this page
   $conditions = apachesolr_search_conditions_default($search_page);
+  // Process our keys so they are clean
+  $keys = rawurldecode($keys);
+
   // Retrieve the results of the search
   $results = apachesolr_search_search_results($keys, $conditions, $search_page);
   // Initiate our build array
@@ -96,8 +99,14 @@ function apachesolr_search_custom_page_search_form(&$form_state, $search_page, $
 function apachesolr_search_custom_page_search_form_submit(&$form, &$form_state) {
   $search_page = $form['#search_page'];
   $redirect = $search_page->search_path;
+
+  // Also encode slashes so we don't get akward situations when obtaining the
+  // search key. We can't use drupal_encode_path because for "aestetic" reasons
+  // they don¡t encode slashes ...
+  $redirect_value = rawurlencode($form_state['values']['keys']);
+
   if (strlen($form_state['values']['keys'])) {
-    $redirect .= '/' . $form_state['values']['keys'];
+    $redirect .= '/' . $redirect_value;
   }
   if (isset($form_state['values']['get'])) {
     $get = json_decode($form_state['values']['get'], TRUE);
