Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c	(revision 40253)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c	(revision 40254)
@@ -4,5 +4,19 @@
 
   Vector **vec;
-  int i, j;
+  int i, j, N;
+
+  int START_VALUE = 0;
+  if ((N = get_argument (argc, argv, "-s"))) {
+    remove_argument (N, &argc, argv);
+    START_VALUE = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  int END_VALUE = -1;
+  if ((N = get_argument (argc, argv, "-e"))) {
+    remove_argument (N, &argc, argv);
+    END_VALUE = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
 
   if (argc < 2) {
@@ -27,5 +41,13 @@
   }
 
-  for (j = 0; j < MaxLen; j++) {
+  // start and end may be 0 - N (truncated to N) or may be negative, in which case it refers to 
+  // distance from the end (just like vector[-5])
+  START_VALUE = (START_VALUE < 0) ? MaxLen + START_VALUE + 1 : MIN (START_VALUE, MaxLen);
+  START_VALUE = MAX (0, START_VALUE);
+
+  END_VALUE = (END_VALUE < 0) ? MaxLen + END_VALUE + 1 : MIN (END_VALUE, MaxLen);
+  END_VALUE = MAX (0, END_VALUE);
+
+  for (j = START_VALUE; j < END_VALUE; j++) {
     for (i = 0; i < Nvec; i++) {
       if (j >= vec[i][0].Nelements) {
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniqpair.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniqpair.c	(revision 40253)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniqpair.c	(revision 40254)
@@ -55,6 +55,8 @@
 
   // storage for the output and count vectors
+  int D_NOUT = 0.02*ID1vec->Nelements;
+
   int Nout = 0;
-  int NOUT = 10000;
+  int NOUT = D_NOUT;
   ResetVector (OUTvec, OPIHI_INT, NOUT);
   if (CNTvec) {
@@ -94,5 +96,5 @@
   for (int i = 0; (i < ID1vec->Nelements) && !interrupt; Nout++) {
     if (Nout >= NOUT) {
-      NOUT += 10000;
+      NOUT += D_NOUT;
       REALLOCATE (vtgt, opihi_int, NOUT);
       if (CNTvec) {
Index: /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/VectorIO.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/VectorIO.c	(revision 40253)
+++ /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/VectorIO.c	(revision 40254)
@@ -41,5 +41,5 @@
     for (j = 0; j < Nvec; j++) {
       // if the format is not defined, just use the native byte-widths
-      tformat[2*j + 0] = (vec[j][0].type == OPIHI_FLT) ? 'D' : 'J';
+      tformat[2*j + 0] = (vec[j][0].type == OPIHI_FLT) ? 'D' : 'K'; // this depends on opihi_int == int64_t for Int
       tformat[2*j + 1] = 0;
     }
@@ -60,7 +60,8 @@
   for (j = 0; j < Nvec; j++) {
     if (vec[j][0].type == OPIHI_FLT) {
-      gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "double", vec[j][0].elements.Flt, vec[j][0].Nelements, nativeOrder);
+      gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "double",  vec[j][0].elements.Flt, vec[j][0].Nelements, nativeOrder);
     } else {
-      gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "int", vec[j][0].elements.Int, vec[j][0].Nelements, nativeOrder);
+//    gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "int",     vec[j][0].elements.Int, vec[j][0].Nelements, nativeOrder);
+      gfits_set_bintable_column_reformat (theader, ftable, vec[j][0].name, "int64_t", vec[j][0].elements.Int, vec[j][0].Nelements, nativeOrder);
     }
   }
@@ -328,5 +329,6 @@
   ASSIGN_DATA(short,   short,   Int);
   ASSIGN_DATA(int,     int,     Int);
-  ASSIGN_DATA(int64_t, int64_t, Flt); // int64_t has a problem: Int is too small, Flt is wrong precision
+  ASSIGN_DATA(int64_t, int64_t, Int); // XXX this works if opihi_int is assigned to int64_t
+//ASSIGN_DATA(int64_t, int64_t, Flt); // int64_t has a problem: Int is too small, Flt is wrong precision
   ASSIGN_DATA(float,   float,   Flt);
   ASSIGN_DATA(double,  double,  Flt);
@@ -353,5 +355,6 @@
   ASSIGN_DATA_TRANSPOSE(short,   short,   Int);
   ASSIGN_DATA_TRANSPOSE(int,     int,     Int);
-  ASSIGN_DATA_TRANSPOSE(int64_t, int64_t, Flt);
+  ASSIGN_DATA_TRANSPOSE(int64_t, int64_t, Int);
+//ASSIGN_DATA_TRANSPOSE(int64_t, int64_t, Flt); // see above comment
   ASSIGN_DATA_TRANSPOSE(float,   float,   Flt);
   ASSIGN_DATA_TRANSPOSE(double,  double,  Flt);
