Fix tree bug

Fix errors if tree doesn't exists.
Merge pull request #16 from proxyfabio/master

Fix tree bug