Use 32bit for summing on averaging to prevent a buffer overflow (pimatic/pimatic#222)