fix get_weight_branches