Fixed a bug in the TreeController