Fixed #23835: Changed circular dependency in DFS to be less infinite