Merge "Zero segment counter before accumulating." into nextgenv2