stats may not have been loaded in the event of .onLoad()
Merge pull request #506 from yihui/bugfix/stats

stats may not have been loaded in the event of .onLoad()