More efforts to deal with the empty refinement history case in HDF5 output.