Fix inherent impl overlap check. The current implementation of the overlap check was slightly buggy, and unified the wrong connected component in the `ids.len() <= 1` case. This became visible in another PR which changed the iteration order of items. r? ``@matthewjasper`` since you reviewed the other PR.