bug in tree iteration.