Debugged merging of edges