Return zero instead of an empty array for count queries with no results

Fixes #5