--- taxonomy_menu/taxonomy_menu.module
+++ taxonomy_menu/taxonomy_menu.module
@@ -773,12 +773,22 @@ function _taxonomy_menu_create_item($args = array()) {
  */
 function _taxonomy_menu_children_has_nodes($tid, $vid) {
   $children = taxonomy_get_children($tid, $vid);
+
+  // Try to find nodes in child terms.
   foreach ($children as $tid => $term) {
     if (_taxonomy_menu_term_count($tid) > 0) {
-      return _taxonomy_menu_children_has_nodes($tid, $vid);
+      return TRUE;
+    }
+  }
+
+  // All children have no nodes. Check their descendents.
+  foreach ($children as $tid => $term) {
+    if (_taxonomy_menu_children_has_nodes($tid, $vid)) {
+      return TRUE;
     }
   }
-  return TRUE;
+
+  return FALSE;
 }
 
 /**
@@ -790,12 +800,17 @@ function _taxonomy_menu_item($item) {
   //if tid is 0 then do not chagne any settings
   if ($item['tid'] > 0) {
     //get the number of node attached to this term
-    $num = _taxonomy_menu_term_count($item['tid']);
+    if (variable_get('taxonomy_menu_display_descendants_'. $item['vid'], FALSE)) {
+      $num = taxonomy_term_count_nodes($item['tid']);
+    }
+    else {
+      $num = _taxonomy_menu_term_count($item['tid']);
+    }
 
     //if hide menu is selected and the term count is 0 and the term has no children then do not create the menu item
     if ($num == 0 &&
         variable_get('taxonomy_menu_hide_empty_terms_'. $item['vid'], FALSE) &&
-        _taxonomy_menu_children_has_nodes($item['tid'], $item['vid'])) {
+        !_taxonomy_menu_children_has_nodes($item['tid'], $item['vid'])) {
 
         $item['remove'] = TRUE;
         return $item;
@@ -803,10 +818,6 @@ function _taxonomy_menu_item($item) {
 
     //if display number is selected and $num > 0 then change the title
     if (variable_get('taxonomy_menu_display_num_'. $item['vid'], FALSE)) {
-      //if number > 0 and display decendants, then count all of the children
-      if (variable_get('taxonomy_menu_display_descendants_'. $item['vid'], FALSE)) {
-        $num = taxonomy_term_count_nodes($item['tid']);
-      }
       $item['name'] .= " ($num)";
     }
   } elseif ($item['tid'] == 0) {
