Fixed else if bug when appending two trees