Hide the stats group headers when there are no results for the section

Fixes #1465 

Hides the headers for the group when there are no results to be shown.