Fixed some additional bugs, now tree is completly working