Fixed some memory leaks and removed treebrowser logic from the path searching