FIX: Integer overflows in average types