diff --git a/menutrails.module b/menutrails.module
index e85037f..54154f7 100644
--- a/menutrails.module
+++ b/menutrails.module
@@ -1,4 +1,5 @@
 <?php
+// $Id: menutrails.module,v 1.4.2.24 2010/03/16 21:18:49 sun Exp $
 
 /**
  * @file
@@ -83,9 +84,14 @@ function menutrails_nodeapi(&$node, $op, $a3 = NULL, $page = FALSE) {
  * Set Breadcrumbs based on active menu trail.
  */
 function menutrails_get_breadcrumbs() {
+  global $custom_theme;
+  
+  $active_theme = variable_get('theme_default','garland');
+  if($custom_theme) $active_theme = $custom_theme;
+  
   $item = menu_get_item();
   // Give first priority to the selected menu.
-  $menu = variable_get('menutrails_menu', FALSE);
+  $menu = variable_get('menutrails_menu_' . $active_theme, FALSE);
   if (!$menu) {
     $menu = db_result(db_query("SELECT menu_name FROM {menu_links} WHERE link_path = '%s' AND module = 'menu'", $item['href']));
   }
@@ -105,10 +111,7 @@ function _menutrails_recurse_crumbs($tree, $item, &$crumbs, $above = array()) {
       foreach ($above as $trail_item) {
         $crumbs[] = l($trail_item['link']['link_title'], $trail_item['link']['link_path']);
       }
-      // Don't add the current page.
-      if ($menu_item['link']['link_path'] != $_GET['q']) {
-        $crumbs[] = l($menu_item['link']['link_title'], $menu_item['link']['link_path']);
-      }
+      $crumbs[] = l($menu_item['link']['link_title'], $menu_item['link']['link_path']);
       break;
     }
     if (is_array($menu_item['below'])) {
@@ -125,8 +128,7 @@ function _menutrails_recurse_crumbs($tree, $item, &$crumbs, $above = array()) {
 function menutrails_node_location($node) {
   // This should only fire if the menu isn't already active.
   $item = menu_get_item();
-  $menu_name = variable_get('menutrails_menu', '');
-  if (db_result(db_query("SELECT count(mlid) FROM {menu_links} WHERE link_path = '%s' AND module = 'menu' AND menu_name = '%s'", $item['href'], $menu_name)) == 0) {
+  if (db_result(db_query("SELECT count(mlid) FROM {menu_links} WHERE link_path = '%s' AND module = 'menu'", $item['href'])) == 0) {
     $type_trails = variable_get('menutrails_node_types', array());
     $href        = $type_trails[$node->type] ? $type_trails[$node->type] : FALSE;
     $term_trails = variable_get('menutrails_terms', array());
@@ -205,14 +207,20 @@ function menutrails_settings_form() {
     '#prefix' => '<p>',
     '#suffix' => '</p>',
   );
-  $form['menutrails_menu'] = array(
-    '#type' => 'select',
-    '#weight' => '-6',
-    '#options' => menu_get_menus(),
-    '#default_value' => variable_get('menutrails_menu', 'primary-links'),
-    '#title' => t('Menutrails Menu'),
-    '#description' => t('What menu are you most interested in assigning trails to? This menu will be used if there is ambiguity about what menu a node falls under.'),
-  );
+  
+  foreach(list_themes() as $name => $theme) {
+  	if($theme->status){
+	  $form['menutrails_menu_' . $name] = array(
+		'#type' => 'select',
+		'#weight' => '-6',
+		'#options' => menu_get_menus(),
+		'#default_value' => variable_get('menutrails_menu_' . $name, 'primary-links'),
+		'#title' => t('Menutrails Menu for ' . $name . ' theme'),
+		'#description' => t('What menu are you most interested in assigning trails to? This menu will be used if there is ambiguity about what menu a node falls under.'),
+	  );  
+	}
+  }
+  
   $form['menutrails_breadcrumbs'] = array(
     '#type' => 'checkbox',
     '#weight' => '-5',
@@ -354,8 +362,8 @@ function menutrails_token_values($type, $object = NULL, $options = array()) {
       foreach ($trail_raw as $title) {
         $trail[] = check_plain($title);
       }
-      $tokens['menu-trail-parents-path-raw'] = !empty($options['pathauto']) ? $trail_raw : implode('/', $trail_raw);
-      $tokens['menu-trail-parents-path'] = !empty($options['pathauto']) ? $trail : implode('/', $trail);
+      $tokens['menu-trail-parents-path-raw'] = implode('/', $trail_raw);
+      $tokens['menu-trail-parents-path'] = implode('/', $trail);
     }
     // Return NULL in case there is no trail.
     else {
@@ -414,17 +422,6 @@ function _menutrails_recurse($tree, $href) {
 }
 
 /**
- * Implementation of hook_theme_registry_alter().
- */
-function menutrails_theme_registry_alter(&$theme_registry) {
-  // If the theme system did not detect another theme override function, change
-  // theme_links() into menutrails_links().
-  if ($theme_registry['links']['function'] == 'theme_links') {
-    $theme_registry['links']['function'] = 'menutrails_links';
-  }
-}
-
-/**
  * Return a themed set of links.
  *
  * The important difference is that we use the in_active_trail bit here to set
@@ -439,7 +436,7 @@ function menutrails_theme_registry_alter(&$theme_registry) {
  * @return
  *   A string containing an unordered list of links.
  */
-function menutrails_links($links, $attributes = array('class' => 'links')) {
+function phptemplate_links($links, $attributes = array('class' => 'links')) {
   global $language;
   $output = '';
 
