Fix logic problem in compute_tag_averages