Bugs fixed in seg_end_of_edges.