Fixed empty tree bug