Fixed graph traversal issue