Issue #139: Fix count and pagination.

the reason I'm not using ``!empty()`` on those places, is that it "forces" us to make sure we initialized those values properly in ``getPublicFields()`` -- otherwise we'll see notices in the tests.