Fixed checking for the graph traversal mode