diff --git a/apachesolr.module b/apachesolr.module
index 6ad39d1..9516d87 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -263,12 +263,15 @@ function apachesolr_enabled_facets_page($realm_name, $environment = NULL) {
 
   // Initializes output with information about which environment's setting we are
   // editing, as it is otherwise not transparent to the end user.
-  $page['apachesolr_environment'] = array(
-    '#theme' => 'apachesolr_settings_title',
-    '#env_id' => $env_id,
-  );
+  $page['apachesolr_environment'] = theme('apachesolr_settings_title', $env_id);
   $page['settings'] = drupal_get_form('facetapi_realm_settings_form', $searcher, $realm_name);
-  return $page;
+
+  $build_output = NULL;
+  foreach($page as $build_result) {
+    $build_output .= $build_result;
+  }
+
+  return $build_output;
 }
 
 /**
@@ -543,16 +546,23 @@ function apachesolr_mark_entity($entity_type, $entity_id) {
 }
 
 /**
- * Implements hook_user().
+ * Implements of hook_user().
  *
  * Mark nodes as needing re-indexing if the author name changes.
  * @todo performance issue. see http://drupal.org/node/592522
  */
-function apachesolr_user_update(&$edit, $account, $category) {
-  if (isset($edit['name']) && $account->name != $edit['name']) {
-    $table = apachesolr_index_get_indexer_table('node');
-    $entity_ids = db_select('node')->fields('node', array('nid'))->where("uid = :uid", array(':uid' => $account->uid));
-    db_update($table)->condition('entity_id', $entity_ids, 'IN')->fields(array('changed' => APACHESOLR_REQUEST_TIME))->execute();
+function apachesolr_user($op, &$edit, &$account) {
+  switch ($op) {
+    case 'update':
+      if (isset($edit['name']) && $account->name != $edit['name']) {
+        $table = apachesolr_index_get_indexer_table('node');
+        $entity_ids = db_select('node')->fields('node', array('nid'))->where("uid = :uid", array(':uid' => $account->uid));
+        db_update($table)
+          ->condition('entity_id', $entity_ids, 'IN')
+          ->fields(array('changed' => APACHESOLR_REQUEST_TIME))
+          ->execute();
+      }
+      break;
   }
 }
 
@@ -563,71 +573,60 @@ function apachesolr_user_update(&$edit, $account, $category) {
  * @todo performance issue. see http://drupal.org/node/592522
  * @todo the rest, such as term deletion.
  */
-function apachesolr_taxonomy_term_update($term) {
-  $table = apachesolr_index_get_indexer_table('node');
-  $entity_ids = db_select('taxonomy_index')->fields('taxonomy_index', array('nid'))->where("tid = :tid", array(':tid' => $term->tid));
-  db_update($table)->condition('nid', $entity_ids, 'IN')->fields(array('changed' => APACHESOLR_REQUEST_TIME))->execute();
+function apachesolr_taxonomy($op, $type, $edit) {
+  if ($type == 'term' && ($op == 'update')) {
+    $table = apachesolr_index_get_indexer_table('node');
+    $entity_ids = db_select('taxonomy_index')->fields('taxonomy_index', array('nid'))->where("tid = :tid", array(':tid' => $edit['tid']));
+    db_update($table)
+      ->condition('nid', $entity_ids, 'IN')
+      ->fields(array('changed' => APACHESOLR_REQUEST_TIME))
+      ->execute();
+  }
+  // TODO: the rest, such as term deletion.
 }
 
 /**
- * Implement hook_comment_*().
+ * Implements hook_comment().
  *
  * Mark nodes as needing re-indexing if comments are added or changed.
  * Like search_comment().
  */
-
-/**
- * Implements hook_comment_insert().
- */
-function apachesolr_comment_insert($comment) {
-  apachesolr_mark_entity('node', $comment->nid);
-}
-
-/**
- * Implements hook_comment_update().
- */
-function apachesolr_comment_update($comment) {
-  apachesolr_mark_entity('node', $comment->nid);
-}
-
-/**
- * Implements hook_comment_delete()
- */
-function apachesolr_comment_delete($comment) {
-  apachesolr_mark_entity('node', $comment->nid);
-}
-
-/**
- * Implements hook_comment_publish()
- */
-function apachesolr_comment_publish($comment) {
-  apachesolr_mark_entity('node', $comment->nid);
-}
-
-/**
- * Implements hook_comment_unpublish()
- */
-function apachesolr_comment_unpublish($comment) {
-  apachesolr_mark_entity('node', $comment->nid);
-}
-
-/**
- * Implements hook_node_type_delete().
- */
-function apachesolr_node_type_delete($info) {
-  apachesolr_index_mark_for_reindex($env_id, $info->type);
+function apachesolr_comment($edit, $op) {
+  $edit = (array) $edit;
+  switch ($op) {
+    // Reindex the node when comments are added or changed
+    case 'insert':
+    case 'update':
+    case 'delete':
+    case 'publish':
+    case 'unpublish':
+      // TODO: do we want to skip this if we are excluding comments
+      // from the index for this node type?
+      apachesolr_mark_entity('node', $edit['nid']);
+      break;
+  }
 }
 
 /**
- * Implements of hook_node_type_update().
- * @todo Support backwards compatibility
+ * Implements hook_node_type().
+ *
+ * Mark nodes as needing re-indexing if a node type name changes.
  */
-function apachesolr_node_type_update($info) {
-  if (!empty($info->old_type) && $info->old_type != $info->type) {
+function apachesolr_node_type($op, $info) {
+  $env_id = apachesolr_default_environment();
+  if ($op == 'delete') {
+    apachesolr_index_mark_for_reindex($env_id, $info->type);
+  }
+  elseif (!empty($info->old_type) && $info->old_type != $info->type) {
     // We cannot be sure we are going before or after node module.
-    $entity_ids = db_select('node')->fields('node', array('nid'))->where("type = :new OR type = :old", array(':new' => $info->type, ':old' => $info->old_type));
+    $entity_ids = db_select('node')
+      ->fields('node', array('nid'))
+      ->where("type = :new OR type = :old", array(':new' => $info->type, ':old' => $info->old_type));
     $table = apachesolr_index_get_indexer_table('node');
-    db_update($table)->condition('entity_id', $entity_ids, 'IN')->fields(array('changed' => APACHESOLR_REQUEST_TIME))->execute();
+    db_update($table)
+      ->condition('entity_id', $entity_ids, 'IN')
+      ->fields(array('changed' => APACHESOLR_REQUEST_TIME))
+      ->execute();
   }
 }
 
@@ -1585,7 +1584,7 @@ function apachesolr_content_extra_fields($content_type) {
 }
 
 /**
- * Implementation of hook_nodeapi().
+ * Implements hook_nodeapi().
  */
 function apachesolr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   switch ($op) {
diff --git a/apachesolr_search.admin.inc b/apachesolr_search.admin.inc
index e8b8a0c..0cffa72 100644
--- a/apachesolr_search.admin.inc
+++ b/apachesolr_search.admin.inc
@@ -40,6 +40,7 @@ function _apachesolr_search_browse_form($default_value) {
 function apachesolr_search_page_list_all() {
   $build['pages'] = apachesolr_search_page_list_pages();
   $build['blocks'] = apachesolr_search_page_list_blocks();
+  $build['config'] = drupal_get_form('apachesolr_search_pages_config_form');
 
   // Print in a similar way as the Drupal 7 version
   $build_print = NULL;
@@ -50,6 +51,23 @@ function apachesolr_search_page_list_all() {
   return $build_print;
 }
 
+function apachesolr_search_pages_config_form(&$form_state) {
+  $search_pages = apachesolr_search_load_all_search_pages();
+  foreach ($search_pages as $search_page_id => $search_page) {
+    $options[$search_page_id] = $search_page['label'];
+  }
+  $options['drupal_core'] = t('Drupal Core Search');
+
+  $form['apachesolr_search_default_search_page'] = array(
+    '#type' => 'radios',
+    '#title' => t('Submit Search block requests to this page'),
+    '#default_value' => variable_get('apachesolr_search_default_search_page', 'drupal_core'),
+    '#options' => $options,
+    '#description' => t('Makes the search block submit to Apache Solr Search'),
+  );
+  return system_settings_form($form);
+}
+
 /**
  * Listing of all the search pages
  * @return array $build
@@ -601,19 +619,18 @@ function apachesolr_bias_settings_page($environment = NULL) {
 
   // Initializes output with information about which environment's setting we are
   // editing, as it is otherwise not transparent to the end user.
-  $output = array(
-    'apachesolr_environment' => array(
-      '#theme' => 'apachesolr_settings_title',
-      '#env_id' => $env_id,
-    ),
-  );
+  $output['apachesolr_environment'] = theme('apachesolr_settings_title', $env_id);
 
   // Adds content bias and type boost / exclusion forms.
   $fields = apachesolr_search_get_fields($environment);
   $form = array();
   $form = drupal_get_form('apachesolr_search_bias_form', $env_id, $fields);
   $output['bias_forms'] = $form;
-  return $output;
+  $output_print = NULL;
+  foreach ($output as $output_field) {
+    $output_print .= $output_field;
+  }
+  return $output_print;
 }
 
 function apachesolr_search_bias_form(&$form_state, $env_id, $fields) {
@@ -622,7 +639,9 @@ function apachesolr_search_bias_form(&$form_state, $env_id, $fields) {
   $form['bias_tabs'] = array(
     '#type' => 'vertical_tabs',
   );
-  $form['actions']['#type'] = 'actions';
+  $form += apachesolr_search_result_bias_form($env_id);
+  $form += apachesolr_search_type_boost_form($env_id);
+  $form += apachesolr_search_field_bias_form($fields, $env_id);
   $form['actions']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save configuration'),
@@ -633,9 +652,6 @@ function apachesolr_search_bias_form(&$form_state, $env_id, $fields) {
     '#value' => t('Reset to defaults'),
     '#submit' => array('apachesolr_search_bias_form_reset'),
   );
-  $form += apachesolr_search_result_bias_form($env_id);
-  $form += apachesolr_search_type_boost_form($env_id);
-  $form += apachesolr_search_field_bias_form($fields, $env_id);
   return $form;
 }
 
@@ -836,14 +852,15 @@ function apachesolr_search_type_boost_form($env_id) {
 
   // Get the current boost values.
   $type_boosts = apachesolr_environment_variable_get($env_id, 'apachesolr_search_type_boosts', array());
-  $names = node_type_get_names();
+  $names = node_get_types();
+
 
-  foreach ($names as $type => $name) {
-    $form['type_boost']['apachesolr_search_type_boosts'][$type] = array(
+  foreach ($names as $type_id => $type) {
+    $form['type_boost']['apachesolr_search_type_boosts'][$type_id] = array(
       '#type' => 'select',
-      '#title' => t('%type type content bias', array('%type' => $name)),
+      '#title' => t('%type type content bias', array('%type' => $type->name)),
       '#options' => $weights,
-      '#default_value' => isset($type_boosts[$type]) ? $type_boosts[$type] : 0,
+      '#default_value' => isset($type_boosts[$type_id]) ? $type_boosts[$type_id] : 0,
     );
   }
 
diff --git a/apachesolr_search.module b/apachesolr_search.module
index bece9a0..22044a2 100644
--- a/apachesolr_search.module
+++ b/apachesolr_search.module
@@ -362,13 +362,15 @@ function apachesolr_search_block_view($delta = '') {
  * Implements hook_form_[form_id]_alter().
  */
 function apachesolr_search_form_block_admin_display_form_alter(&$form) {
-  foreach ($form['blocks'] as $key => $block) {
-    if ((strpos($key, "apachesolr_search_mlt-") === 0) && $block['module']['#value'] == 'apachesolr_search') {
-      $form['blocks'][$key]['delete'] = array(
-        '#type' => 'link',
-        '#title' => 'delete',
-        '#href' => 'admin/settings/apachesolr/search-pages/block/' . $block['delta']['#value'] . '/delete',
-      );
+  foreach ($form as $key => $block) {
+    if (isset($block['delta']['#value'])) {
+      if ((strpos($key, "apachesolr_search_mlt-") === 0) && $block['module']['#value'] == 'apachesolr_search') {
+        $form['blocks'][$key]['delete'] = array(
+          '#type' => 'link',
+          '#title' => 'delete',
+          '#href' => 'admin/settings/apachesolr/search-pages/block/' . $block['delta']['#value'] . '/delete',
+        );
+      }
     }
   }
 }
@@ -500,45 +502,112 @@ function theme_apachesolr_search_mlt_recommendation_block($vars) {
 }
 
 /**
- * Implementation of hook_search_info().
+ * Implementation of hook_search().
  */
-function apachesolr_search_search_info() {
-  // Load our core search page
-  // This core search page is assumed to always be there. It cannot be deleted.
-  $search_page = apachesolr_search_page_load('core_search');
+function apachesolr_search_search($op = 'search', $keys = NULL) {
 
-  // This can happen during install, or if the DB was manually changed.
-  if (empty($search_page)) {
-    $search_page = new stdClass();
-    $search_page->page_title = 'Site';
-    $search_page->search_path = 'search/site';
-  }
+  switch ($op) {
+    case 'reset':
+      $env_id = apachesolr_default_environment();
+      apachesolr_index_mark_for_reindex($env_id);
+      return;
 
-  return array(
-    'title' => $search_page->page_title,
-    'path' => str_replace('search/', '', $search_page->search_path),
-    'conditions_callback' => variable_get('apachesolr_search_conditions_callback', 'apachesolr_search_conditions'),
-  );
+    case 'status':
+      $env_id = apachesolr_default_environment();
+      return apachesolr_index_status($env_id);
+
+/*    case 'search':
+      $conditions_callback = variable_get('apachesolr_search_conditions_callback', 'apachesolr_search_conditions');
+      $conditions = call_user_func($conditions_callback);
+      try {
+        $results = apachesolr_search_search_execute($keys, $conditions);
+        dsm($results);
+        return $results;
+      }
+      catch (Exception $e) {
+        watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+        apachesolr_failure(t('Solr search'), $keys);
+      }
+      break;
+ */
+  } // switch
+}
+
+/**
+ * Implementation of hook_form_[form_id]_alter().
+ *
+ * This adds the 0 option to the search admin form.
+ */
+function apachesolr_search_form_search_admin_settings_alter(&$form, $form_state) {
+  $form['indexing_throttle']['search_cron_limit']['#options']['0'] = '0';
+  ksort($form['indexing_throttle']['search_cron_limit']['#options']);
 }
 
 /**
- * Implementation of hook_search_reset().
+ * Implementation of hook_form_[form_id]_alter().
  */
-function apachesolr_search_search_reset() {
-  $env_id = apachesolr_default_environment();
-  apachesolr_index_mark_for_reindex($env_id);
+function apachesolr_search_form_search_theme_form_alter(&$form, $form_state) {
+  apachesolr_search_form_search_block_form_alter($form, $form_state);
 }
 
 /**
- * Implementation of hook_search_status().
+ * Implementation of hook_form_[form_id]_alter().
  */
-function apachesolr_search_search_status() {
-  $env_id = apachesolr_default_environment();
-  return apachesolr_index_status($env_id);
+function apachesolr_search_form_search_block_form_alter(&$form, &$form_state) {
+  $search_pages = apachesolr_search_load_all_search_pages();
+  $redirect_to = variable_get('apachesolr_search_default_search_page', 'drupal_core');
+  if ($redirect_to == 'drupal_core') {
+    return;
+  }
+
+  if (!empty($search_pages[$redirect_to])) {
+    $form['#action'] = url($search_pages[$redirect_to]['search_path']);
+    if (!isset($form['#submit'])) {
+      $form['#submit'] = array('apachesolr_search_search_box_form_submit');
+    }
+    else {
+      $key = array_search('search_box_form_submit', $form['#submit']);
+      if ($key !== FALSE) {
+        // Replace the search module's function.
+        $form['#submit'][$key] = 'apachesolr_search_search_box_form_submit';
+      }
+    }
+  }
+}
+
+/**
+ * Process a block search form submission.
+ *
+ * @see search_box_form_submit()
+ */
+function apachesolr_search_search_box_form_submit($form, &$form_state) {
+  // The search form relies on control of the redirect destination for its
+  // functionality, so we override any static destination set in the request,
+  // for example by drupal_access_denied() or drupal_not_found()
+  // (see http://drupal.org/node/292565).
+  if (isset($_REQUEST['destination'])) {
+    unset($_REQUEST['destination']);
+  }
+  if (isset($_REQUEST['edit']['destination'])) {
+    unset($_REQUEST['edit']['destination']);
+  }
+
+  $form_id = $form['form_id']['#value'];
+  $keys = $form_state['values'][$form_id];
+  // Handle Apache webserver clean URL quirks.
+  if (variable_get('clean_url', '0')) {
+    $keys = str_replace('+', '%2B', $keys);
+  }
+  $path = $form['#action'];
+  // Remove leading slash
+  ($path{0} == "/" ) ? $path = substr($path, 1) : '';
+  // Set our path to the correct search page
+  $form_state['redirect'] = $path . '/' .trim($keys);
 }
 
+
 /**
- * Implementation of hook_search_execute().
+ * Helper function to retrieve results
  * @param $keys
  *   The keys that are available after the path that is defined in
  *   hook_search_info
@@ -552,7 +621,7 @@ function apachesolr_search_search_execute($keys = NULL, $conditions = NULL) {
 }
 
 /**
- * Implementation of a search_view() conditions callback.
+ * The default conditions callback.
  */
 function apachesolr_search_conditions() {
   //get default conditions from the core_search
@@ -562,7 +631,7 @@ function apachesolr_search_conditions() {
 }
 
 /**
- * Implements hook_search_page().
+ * The default search page
  * @param $results
  *   The results that came from apache solr
  */
