terml/nodes: Fix bags to have unordered comparisons.