Fix hdf5 output data layout