fixed known bugs in Tree