Fix bug in find_edge_range()

This fixes issue #281.
8 jobs for master