fixes to Tree class