Fix batching for calculations.

I'm only worried about the count being 0. If the sum is zero, then the avg is 0 and that is fine.