Cleanup imports in paths-to-tree algorithm