Fix permutation of dimensions in hdf5 file