Fixes 'Creating default object from empty value' error

$myQuery wasn't defined previously, $countQuery was.
Merge pull request #160 from BasMulders/patch-1

Fixes 'Creating default object from empty value' error