Found bug causing incorrect tree formatting