Fix bug in hdf5 read/write vector