Fixed tree creating and destroying

Added sub, no memory leaks now.