Found bug for #3: memset not clearning avg_n array properly