Fixed a bug in direct growing of trees