Index: trunk/ippTools/src/difftool.c
===================================================================
--- trunk/ippTools/src/difftool.c	(revision 20683)
+++ trunk/ippTools/src/difftool.c	(revision 20684)
@@ -939,12 +939,12 @@
     psMetadata *stackWhere = psMetadataAlloc();
 
-    PXOPT_COPY_S64(config->args, warpWhere, "-warp_id", "warpsToDiff.warp_id", "==");
-    PXOPT_COPY_STR(config->args, warpWhere, "-skycell_id", "warpsToDiff.skycell_id", "==");
-    PXOPT_COPY_STR(config->args, warpWhere, "-tess_id", "warpsToDiff.tess_id", "==");
-    PXOPT_COPY_STR(config->args, warpWhere, "-filter", "warpsToDiff.filter", "==");
-    PXOPT_COPY_STR(config->args, warpWhere, "-warp_label", "warpsToDiff.warp_label", "==");
+    PXOPT_COPY_S64(config->args, warpWhere, "-warp_id", "warpRun.warp_id", "==");
+    PXOPT_COPY_STR(config->args, warpWhere, "-skycell_id", "warpRun.skycell_id", "==");
+    PXOPT_COPY_STR(config->args, warpWhere, "-tess_id", "warpRun.tess_id", "==");
+    PXOPT_COPY_STR(config->args, warpWhere, "-filter", "rawExp.filter", "==");
+    PXOPT_COPY_STR(config->args, warpWhere, "-warp_label", "warpRun.label", "==");
     PXOPT_COPY_STR(config->args, warpWhere,  "-kind", "warpsToDiff.kind", "==");
-    PXOPT_COPY_F32(config->args, warpWhere,  "-good_frac", "warpsToDiff.good_frac", ">=");
-    PXOPT_COPY_STR(config->args, stackWhere, "-stack_label", "stacksForDiff.stack_label", "==");
+    PXOPT_COPY_F32(config->args, warpWhere,  "-good_frac", "warpSkyfile.good_frac", ">=");
+    PXOPT_COPY_STR(config->args, stackWhere, "-stack_label", "stackRun.label", "==");
 
     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required options
@@ -991,5 +991,7 @@
     psFree(stackWhere);
 
-    if (!p_psDBRunQuery(config->dbh, query, warpWhere, stackWhere)) {
+    psTrace("difftool", 1, query, warpQuery, stackQuery);
+
+    if (!p_psDBRunQuery(config->dbh, query, warpQuery, stackQuery)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(query);
@@ -1046,6 +1048,6 @@
         }
 
-        if (!populatedrun(list, workdir, skycell_id, tess_id, label, reduction, warp_id, PS_MAX_S64, PS_MAX_S64,
-                          stack_id, config)) {
+        if (!populatedrun(list, workdir, skycell_id, tess_id, label, reduction, warp_id,
+                          PS_MAX_S64, PS_MAX_S64, stack_id, config)) {
             psWarning("Unable to add run for %s,%s,%" PRId64 ",%" PRId64, skycell_id, tess_id,
                       warp_id, stack_id);
