Fixed crash printing originsets in list-terms.
Some bug fixes to remove-valve-selector.