Properly handle empty counts
Merge branch 'master' into gh-pages