Fix some printing issues; use fresh names in tree generation.

This partially-addresses @puffnfresh's review comments.