This patch is pulling a recent bug fix from the Rivet development branch into Rivet_i until we get a new Rivet release.
Rivet_i
cc/ @ewelina @lcorpe @dkar @nwarrack