Tree bug fix