Fix bugs in HDF5 file creation (still broken)