Fixed NPE in DFS