Fix would_close_tree logic