Index: /branches/end_stage/ippTools/src/regtool.c
===================================================================
--- /branches/end_stage/ippTools/src/regtool.c	(revision 16149)
+++ /branches/end_stage/ippTools/src/regtool.c	(revision 16150)
@@ -621,4 +621,14 @@
     psFree(output);
 
+    // carry through these values
+    // new CLI options overwrite existing values
+    workdir   = workdir ? workdir : newExp->workdir;
+    reduction = reduction ? reduction : newExp->reduction;
+    dvodb     = dvodb ? dvodb : newExp->dvodb;
+    tess_id   = tess_id ? tess_id : newExp->tess_id;
+    end_stage = end_stage ? end_stage : newExp->end_stage;
+
+    psFree(newExp);
+
     if (!rawExpInsert(config->dbh,
         (psS64)atoll(exp_id),
@@ -630,9 +640,9 @@
         exp_type,
         filelevel,
-        workdir ? workdir : newExp->workdir,
-        reduction ? reduction : newExp->reduction,
-        dvodb ? dvodb : newExp->dvodb,
-        tess_id ? tess_id : newExp->tess_id,
-        end_stage ? end_stage : newExp->end_stage,
+        workdir,
+        reduction,
+        dvodb,
+        tess_id,
+        end_stage,
         filter,
         comment,
@@ -684,5 +694,4 @@
         }
         psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(newExp);
         return false;
     }
@@ -695,5 +704,4 @@
         }
         psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id);
-        psFree(newExp);
         return false;
     }
@@ -704,8 +712,8 @@
     // this can only be run as the newExp's state has been set to stop
     if (!pxchipQueueByExpTag(config,
-                newExp->exp_id,
-                newExp->workdir,
+                (psS64)atoll(exp_id),
+                workdir,
                 NULL, // label
-                newExp->reduction,
+                reduction,
                 NULL, // expgroup
                 dvodb,
@@ -718,8 +726,6 @@
         }
         psError(PS_ERR_UNKNOWN, false, "failed to queue chipPendingExp");
-        psFree(newExp);
-        return false;
-    }
-    psFree(newExp);
+        return false;
+    }
 
     if (!psDBCommit(config->dbh)) {
