Index: /trunk/Ohana/src/dvomerge/include/dvomerge.h
===================================================================
--- /trunk/Ohana/src/dvomerge/include/dvomerge.h	(revision 39535)
+++ /trunk/Ohana/src/dvomerge/include/dvomerge.h	(revision 39536)
@@ -57,4 +57,5 @@
 int    MATCHED_TABLES;
 int    RESET_STARPAR;
+int    RESET_LENSING;
 
 int    SKIP_MEASURE;
@@ -281,2 +282,3 @@
 char **load_cptlist (char *filename, int *nlist);
 int ResetStarPar (Catalog *catalog);
+int ResetLensing (Catalog *catalog);
Index: /trunk/Ohana/src/dvomerge/src/LoadCatalog.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 39535)
+++ /trunk/Ohana/src/dvomerge/src/LoadCatalog.c	(revision 39536)
@@ -65,2 +65,21 @@
   return TRUE;
 }
+
+int ResetLensing (Catalog *catalog) {
+
+  off_t i;
+
+  // we are going to delete the lensing values:
+
+  catalog[0].Nlensing = 0;
+  catalog[0].Nlensing_disk = 0;
+  catalog[0].Nlensing_off = 0;
+
+  REALLOCATE (catalog[0].lensing, Lensing, 1);
+
+  for (i = 0; i < catalog[0].Naverage; i++) {
+    catalog[0].average[i].Nlensing = 0;
+    catalog[0].average[i].lensingOffset = -1;
+  }
+  return TRUE;
+}
Index: /trunk/Ohana/src/dvomerge/src/args.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/args.c	(revision 39535)
+++ /trunk/Ohana/src/dvomerge/src/args.c	(revision 39536)
@@ -69,8 +69,13 @@
   }
 
-  /* extra error messages */
+  /* extra options */
   RESET_STARPAR = FALSE;
   if ((N = get_argument (*argc, argv, "-reset-starpar"))) {
     RESET_STARPAR = TRUE;
+    remove_argument (N, argc, argv);
+  }
+  RESET_LENSING = FALSE;
+  if ((N = get_argument (*argc, argv, "-reset-lensing"))) {
+    RESET_LENSING = TRUE;
     remove_argument (N, argc, argv);
   }
@@ -119,5 +124,7 @@
   if ((N = get_argument (*argc, argv, "-restrict-cpt"))) {
     remove_argument (N, argc, argv);
-    CPTLIST_FILENAME = strcreate (argv[N]);
+    char *tmppath = strcreate (argv[N]);
+    CPTLIST_FILENAME = abspath(tmppath, DVO_MAX_PATH);
+    free (tmppath);
     CPTLIST = load_cptlist (CPTLIST_FILENAME, &NCPTLIST);
     remove_argument (N, argc, argv);
@@ -350,4 +357,9 @@
     remove_argument (N, argc, argv);
   }
+  RESET_LENSING = FALSE;
+  if ((N = get_argument (*argc, argv, "-reset-lensing"))) {
+    RESET_LENSING = TRUE;
+    remove_argument (N, argc, argv);
+  }
 
   /* extra error messages */
Index: /trunk/Ohana/src/dvomerge/src/build_links.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/build_links.c	(revision 39535)
+++ /trunk/Ohana/src/dvomerge/src/build_links.c	(revision 39536)
@@ -408,4 +408,7 @@
   off_t *next_star;
 
+  if (!starpar) return NULL;
+  if (SKIP_STARPAR) return NULL;
+
   N = 0;
 
@@ -565,4 +568,7 @@
   off_t *next_galp;
 
+  if (galphot) return NULL;
+  if (SKIP_GALPHOT) return NULL;
+
   N = 0;
 
Index: /trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
===================================================================
--- /trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c	(revision 39535)
+++ /trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c	(revision 39536)
@@ -184,4 +184,8 @@
 	myAssert (MATCHED_TABLES, "must use -matched-tables to reset starpar");
 	ResetStarPar (&outcatalog);
+      }
+      if (RESET_LENSING) {
+	myAssert (MATCHED_TABLES, "must use -matched-tables to reset lensing");
+	ResetLensing (&outcatalog);
       }
 
@@ -328,5 +332,4 @@
     if (UPDATE_CATFORMAT)    { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); }
     if (UPDATE_CATCOMPRESS)  { strextend (&command, "-update-catcompress %s", UPDATE_CATCOMPRESS); }
-    if (CPTLIST_FILENAME)    { strextend (&command, "-restrict-cpt %s", CPTLIST_FILENAME); }
     if (REPAIR_BY_OBJID)     { strextend (&command, "-repair-by-objid"); }
 
@@ -337,4 +340,5 @@
 
     if (RESET_STARPAR)              { strextend (&command, "-reset-starpar"); }
+    if (RESET_LENSING)              { strextend (&command, "-reset-lensing"); }
     if (ALLOW_MISSING_INPUT_IMAGES) { strextend (&command, "-allow-missing-input-images"); }
     if (CPTLIST_FILENAME)           { strextend (&command, "-restrict-cpt %s", CPTLIST_FILENAME); }
