Tiff and hdf5 working, several improvements