Fixed errors in DFS