This fixes #7965.  It was creating the select input incorrectly, so it was giving the wrong name to the averages.