Index: /trunk/ippTools/share/dettool_stop_completed_correct_runs.sql
===================================================================
--- /trunk/ippTools/share/dettool_stop_completed_correct_runs.sql	(revision 20374)
+++ /trunk/ippTools/share/dettool_stop_completed_correct_runs.sql	(revision 20375)
@@ -1,2 +1,3 @@
+-- det1 is the 'correction' detRun, det2 is the 'parent' detRun 
 UPDATE detRun
 SET state = 'stop'
@@ -8,5 +9,5 @@
     FROM detRun AS det1
     INNER JOIN detRun as det2
-        ON det1.ref_det_run = det2.det_id 
+        ON det1.ref_det_id = det2.det_id 
 	-- do we need to restrict by iteration?  not clear this logic below is right or tested
     JOIN detNormalizedImfile as imfile
Index: /trunk/ippTools/src/dettoolConfig.c
===================================================================
--- /trunk/ippTools/src/dettoolConfig.c	(revision 20374)
+++ /trunk/ippTools/src/dettoolConfig.c	(revision 20375)
@@ -172,7 +172,12 @@
     // -makecorrection
     psMetadata *makecorrectionArgs = psMetadataAlloc();
+    psMetadataAddStr(makecorrectionArgs, PS_LIST_TAIL, "-det_type",  0,   "set detrend type of corrected detRun", NULL);
     psMetadataAddS64(makecorrectionArgs, PS_LIST_TAIL, "-det_id",  0,     "detRun det_id to be corrected (required)", 0);
     psMetadataAddS32(makecorrectionArgs, PS_LIST_TAIL, "-iteration",  0,  "detRun iteration to be corrected (required)", -1);;
     psMetadataAddBool(makecorrectionArgs, PS_LIST_TAIL, "-simple", 0,            "use the simple output format", false);
+
+    psMetadataAddStr(makecorrectionArgs, PS_LIST_TAIL, "-workdir",  0,   "set workdir", NULL);
+    psMetadataAddStr(makecorrectionArgs, PS_LIST_TAIL, "-reduction",  0, "set reduction", NULL);
+    psMetadataAddStr(makecorrectionArgs, PS_LIST_TAIL, "-label",  0,     "set label", NULL);
 
     // -tocorrectexp
@@ -184,4 +189,5 @@
     psMetadata *tocorrectimfileArgs = psMetadataAlloc();
     psMetadataAddS64(tocorrectimfileArgs, PS_LIST_TAIL, "-det_id", 0,            "search for detrend ID", 0);
+    psMetadataAddStr(tocorrectimfileArgs, PS_LIST_TAIL, "-det_type",  0,   "search by type of corrected detRun", NULL);
     psMetadataAddU64(tocorrectimfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
     psMetadataAddBool(tocorrectimfileArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
