tolerate zero length branches for get_tree_ages