Add print_tree before waiting for a key to be pressed.