Fix statistics page

Various improvements to the statistics page.