Fix depth limit in graph BFS/DFS.