Fixed some bugs in the tree prettifier.