Avoid duplicate additions to inter-gen set.

This was wrongly handled in one place, and handled with duplicate code
in two others.