fix branch_ancestry bug