Fix the potential breakage with merge_by_subgraph

We enforce that the intersection has exactly the same !-box containment
on both sides.