Refactored print_tree functions, deal with level 0 more gracefully