Correct an error in dfs routine.