Fix bug in HDF5 io (still not fully implemented)