Fix tree destroy
Work on resource release