This fixes #7854.  It now is more slow about creating averages.