Fixed issue with merging common edges