Some fixes with the region duplication check.