Fix #1972.
Micro optimize not to generate json for html.
Merge pull request #1975 from gittip/fix-stats-json

Fix #1972.