Fix count calculations in production