Code cleaning in dfs.cpp.