Improved the tree-drawing code slightly, it now seems to work exactly as intended.