Fix various bug due to HDF5