add test_bounds and fix bug in _edges
Merge pull request #582 from ndawe/master

add test_bounds and fix bug in _edges