Index: category.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/category/category.module,v
retrieving revision 1.157
diff -u -p -r1.157 category.module
--- category.module	5 Mar 2009 22:23:54 -0000	1.157
+++ category.module	31 May 2009 09:13:10 -0000
@@ -1671,7 +1671,7 @@ function category_node_listing($node) {
     }
   }
   else {
-    $category_display = isset($node->category_display['cid']) ? $node->category_display : category_display_get_container($node->category['cnid']);
+    $category_display = isset($node->category_display['cid']) ? (object) $node->category_display : category_display_get_container($node->category['cnid']);
     if ($category_display->show_listing) {
       if ($is_container) {
         if ($node->category['depth']) {
Index: category_display/category_display.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/category/category_display/category_display.module,v
retrieving revision 1.38
diff -u -p -r1.38 category_display.module
--- category_display/category_display.module	7 Feb 2009 09:01:16 -0000	1.38
+++ category_display/category_display.module	31 May 2009 09:13:14 -0000
@@ -626,7 +626,7 @@ function _category_display_children_redu
       }
       else {
         if (!empty($tree[$key]['below'])) {
-          $new_tree = _category_display_children_reduce($tree[$key]['below'], $book_link, $category_display, TRUE);
+          $new_tree += _category_display_children_reduce($tree[$key]['below'], $book_link, $category_display, TRUE);
         }
       }
     }
@@ -655,7 +655,8 @@ function _category_display_children_prun
         $matches = array();
         preg_match('/^node\/(\d+)$/', $tree[$key]['link']['link_path'], $matches);
         if (!empty($matches[1]) && $type = db_result(db_query("SELECT type FROM {node} WHERE nid = %d", $matches[1]))) {
-          if (db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {category_node} cn ON n.nid = cn.nid WHERE n.type = '%s'", $type))) {
+          $behavior = variable_get('category_behavior_'. $type, 0);
+          if (empty($behavior) && db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {category_node} cn ON n.nid = cn.nid WHERE n.type = '%s'", $type))) {
             $include_link = FALSE;
           }
         }
