Index: branches/simmosaic_branches/ippTools/src/pztool.c
===================================================================
--- branches/simmosaic_branches/ippTools/src/pztool.c	(revision 24860)
+++ branches/simmosaic_branches/ippTools/src/pztool.c	(revision 27839)
@@ -117,5 +117,6 @@
             telescope,
             uri,
-            NULL  // epoch
+            NULL,  // epoch
+            0      // use_compress
         )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -304,5 +305,5 @@
     psArray *cameras = pzGetPendingCameras(config);
     if (!cameras) {
-        psError(PXTOOLS_ERR_DATA, false, "failed to find any cameras");
+        psError(PXTOOLS_ERR_CONFIG, false, "failed to find any cameras");
         return false;
     }
@@ -314,5 +315,5 @@
         psString query = pxDataGet("pztool_pendingimfile.sql");
         if (!query) {
-            psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
             psFree(cameraImfiles);
             return false;
@@ -401,4 +402,6 @@
     PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
     PXOPT_LOOKUP_BOOL(row_lock, config->args, "-row_lock", false);
+    PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", false, false);
+    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
 
     // default values
@@ -457,5 +460,7 @@
             fault,
             NULL,    // epoch
-            hostname
+            hostname,
+            bytes,
+            md5sum
     )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -488,5 +493,5 @@
     psString query = pxDataGet("pztool_find_completed_exp.sql");
     if (!query) {
-        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
         return false;
     }
@@ -595,5 +600,7 @@
                 "       pzDownloadImfile.class_id," // tmp_class_id
                 "       pzDownloadImfile.uri,"      // uri
-                "       NULL"                       // epoch
+                "       NULL,"                       // epoch
+                "       pzDownloadImfile.bytes,"    // bytes
+                "       pzDownloadImfile.md5sum"    // md5sum
                 "   FROM pzDownloadImfile"
                 "   WHERE"
@@ -777,5 +784,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_STR(config->args, where,  "-exp_name", "exp_name", "==");
-    PXOPT_COPY_STR(config->args, where, "-inst", "inst", "==");
+    PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
     PXOPT_COPY_STR(config->args, where, "-telescope", "telescope", "==");
     PXOPT_COPY_STR(config->args, where,  "-class", "class", "==");
@@ -801,5 +808,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_STR(config->args, where,  "-exp_name", "exp_name", "==");
-    PXOPT_COPY_STR(config->args, where, "-inst", "inst", "==");
+    PXOPT_COPY_STR(config->args, where, "-inst", "camera", "==");
     PXOPT_COPY_STR(config->args, where, "-telescope", "telescope", "==");
     PXOPT_COPY_STR(config->args, where,  "-class", "class", "==");
@@ -808,5 +815,5 @@
     psString query = pxDataGet("pztool_revertcopied.sql");
     if (!query) {
-        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
         return false;
     }
@@ -842,5 +849,5 @@
     psString query = pxDataGet("pztool_revert_downloadimfile_faults.sql");
     if (!query) {
-        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
         return false;
     }
@@ -857,5 +864,5 @@
     psString query = pxDataGet("pztool_revert_fileset_faults.sql");
     if (!query) {
-        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
+        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
         return false;
     }
