diff --git a/tabtamer.admin.inc b/tabtamer.admin.inc
index 37f10f3..19ed258 100644
--- a/tabtamer.admin.inc
+++ b/tabtamer.admin.inc
@@ -103,11 +103,14 @@ function _tabtamer_convert_to_single_array(&$tabs, $tabs_source, $last_default_p
     return;
   }
 
-  // If there is a MENU_DEFAULT_LOCAL_TASK at this level then set $last_default_path.
+  // If there is a MENU_DEFAULT_LOCAL_TASK or this is the only item at this level then set $last_default_path.
   foreach ($tabs_source as $key => $val) {
-    if (is_array($val) && isset($val['type']) && ($val['type'] == MENU_DEFAULT_LOCAL_TASK || empty($val['type']))) {
-      $last_default_path = $current_path;
-      break;
+    if (is_array($val)) {
+      if (empty($val['type']) || $val['type'] == MENU_DEFAULT_LOCAL_TASK ||
+        ($last_default_path == '' && $val['type'] == MENU_LOCAL_TASK)) {
+        $last_default_path = $current_path;
+        break;
+      }
     }
   }
 
@@ -142,13 +145,6 @@ function _tabtamer_true_base($path) {
 }
 
 /**
- * Implements hook_theme().
- */
-function tabtamer_theme($existing, $type, $theme, $path) {
-  return array('tabtamer_tabs_form' => array('render element' => 'form'));
-}
-
-/**
  * Theme function for the tabtamer_tabs_form() form.
  */
 function theme_tabtamer_tabs_form($variables) {
diff --git a/tabtamer.module b/tabtamer.module
index 15ec8a3..06c2dad 100644
--- a/tabtamer.module
+++ b/tabtamer.module
@@ -14,6 +14,13 @@ define('TABTAMER_CACHE_ID', 'tabtamer_cache');
 define('TABTAMER_CACHE_TABLE', 'cache_menu');
 
 /**
+ * Implements hook_theme().
+ */
+function tabtamer_theme($existing, $type, $theme, $path) {
+  return array('tabtamer_tabs_form' => array('render element' => 'form'));
+}
+
+/**
  * Implements hook_menu().
  */
 function tabtamer_menu() {
