Index: src/gnome-utils/gnc-tree-model-price.c
===================================================================
--- src/gnome-utils/gnc-tree-model-price.c	(revision 17402)
+++ src/gnome-utils/gnc-tree-model-price.c	(working copy)
@@ -340,10 +340,10 @@
 /*        Gnc Tree Model Debugging Utility Function         */
 /************************************************************/
 
-#define debug_path(fn, path) {				\
-    gchar *path_string = gtk_tree_path_to_string(path); \
-    fn("tree path %s", path_string);			\
-    g_free(path_string);				\
+#define debug_path(fn, path) {					\
+    gchar *path_string = gtk_tree_path_to_string(path); 	\
+    fn("tree path %s", path_string? path_string : "(NULL)");	\
+    g_free(path_string);					\
   }
 
 #define ITER_STRING_LEN 256
@@ -487,7 +487,7 @@
 	g_return_val_if_fail (GNC_IS_TREE_MODEL_PRICE (tree_model), FALSE);
 	
 	depth = gtk_tree_path_get_depth (path);
-	ENTER("model %p, iter, %p, path %p (depth %d)", tree_model, iter, path, depth);
+	ENTER("model %p, iter %p, path %p (depth %d)", tree_model, iter, path, depth);
 	debug_path(DEBUG, path);
 
 	model = GNC_TREE_MODEL_PRICE (tree_model);
@@ -1336,16 +1336,23 @@
   /* Tag the new item as inserted. */
   gtk_tree_model_row_inserted (tree_model, path, iter);
 
-  /*  */
   gtk_tree_path_up(path);
-  while (gtk_tree_path_get_depth(path) != 0) {
-      if (gtk_tree_model_get_iter(tree_model, &tmp_iter, path)) {
-          gtk_tree_model_row_changed(tree_model, path, &tmp_iter);
-          if (gtk_tree_model_iter_n_children(tree_model, &tmp_iter) == 1) {
-              gtk_tree_model_row_has_child_toggled(tree_model, path, &tmp_iter);
-          }
-      }
+  if (gtk_tree_path_get_depth(path) > 0 &&
+      gtk_tree_model_get_iter(tree_model, &tmp_iter, path)) {
+    /* Signal the change to the parent. */
+    gtk_tree_model_row_changed(tree_model, path, &tmp_iter);
+
+    /* Is this the parent's first child? */
+    if (gtk_tree_model_iter_n_children(tree_model, &tmp_iter) == 1)
+        gtk_tree_model_row_has_child_toggled(tree_model, path, &tmp_iter);
+
+    /* Signal any other ancestors. */
+    gtk_tree_path_up(path);
+    while (gtk_tree_path_get_depth(path) > 0 &&
+           gtk_tree_model_get_iter(tree_model, &tmp_iter, path)) {
+      gtk_tree_model_row_changed(tree_model, path, &tmp_iter);
       gtk_tree_path_up(path);
+    }
   }
   gtk_tree_path_free(path);
 
@@ -1396,20 +1403,25 @@
 static gboolean
 gnc_tree_model_price_do_deletions (gpointer unused)
 {
-  GSList *iter, *next = NULL;
   remove_data *data;
 
-  for (iter = pending_removals; iter != NULL; iter = next) {
-    next = g_slist_next(iter);
-    data = iter->data;
-    pending_removals = g_slist_delete_link (pending_removals, iter);
+  ENTER(" ");
+  while (pending_removals)
+  {
+    data = pending_removals->data;
+    pending_removals = g_slist_delete_link(pending_removals, pending_removals);
 
-    gtk_tree_model_row_deleted (GTK_TREE_MODEL(data->model), data->path);
-    gnc_tree_model_price_path_deleted (data->model, data->path);
-    gtk_tree_path_free(data->path);
-    g_free(data);
+    if (data)
+    {
+      debug_path(DEBUG, data->path);
+      gtk_tree_model_row_deleted(GTK_TREE_MODEL(data->model), data->path);
+      gnc_tree_model_price_path_deleted(data->model, data->path);
+      gtk_tree_path_free(data->path);
+      g_free(data);
+    }
   }
 
+  LEAVE(" ");
   /* Remove me */
   return FALSE;
 }
@@ -1519,8 +1531,11 @@
 	  data->model = model;
 	  data->path = path;
 	  pending_removals = g_slist_append (pending_removals, data);
-	  g_idle_add_full(G_PRIORITY_HIGH_IDLE,
-			  gnc_tree_model_price_do_deletions, NULL, NULL);
+//DEBUG
+gnc_tree_model_price_do_deletions(NULL);
+//	  g_idle_add_full(G_PRIORITY_HIGH_IDLE,
+//			  gnc_tree_model_price_do_deletions, NULL, NULL);
+
 	  LEAVE(" ");
 	  return;
 
