* Improved exception handling
* Fixed infinite dfs loop bug