Fix DFS (issue #233) by checking previous node exploration first at queue removal
Merge pull request #265 from jansoe/fixDFS

Fix DFS (issue #233)