Bits of cleanup, can now write 1-2 column of ints successfully

Now we can write files ok! Added better logging.