Use integers instead of floats when computing averages.

This is how averages where computed prior to this patch. And it makes
sense, since half bytes doesn't exist.