wbt_fix_dangling_arcs function

Fix dangling arcs