Index: trunk/ippTools/src/magictool.c
===================================================================
--- trunk/ippTools/src/magictool.c	(revision 18700)
+++ trunk/ippTools/src/magictool.c	(revision 18701)
@@ -699,4 +699,9 @@
     }
 
+    if (!node->data) {
+        // It's a leaf node, not done
+        return false;
+    }
+
     if (psMetadataLookupBool(NULL, node->data, "done")) {
         // It's already done
@@ -712,4 +717,10 @@
         while ((child = psListGetAndIncrement(iter))) {
             psMetadata *data = child->data;
+            if (!data) {
+                // Child is a leaf node, not done
+                psFree(iter);
+                psFree(work);
+                return false;
+            }
 
             bool status = false;
@@ -853,7 +864,7 @@
 
     // find the root of the tree
-    pxNode *root = psHashLookup(forest, "root");
+    pxNode *root = psMemIncrRefCounter(psHashLookup(forest, "root"));
     psFree(forest);
-    // pxTreePrint(stdout, root);
+    //    pxTreePrint(stdout, root);
 
     // crawl through the tree and looking for nodes with children that are all
