Fixed some tree problems