Fix badly formed edges.