Fixing cdbd1fb, countMasterResults always avail.

Previous commit altered the { } structure negatively, this will fix the
error where the query was not being built properly, while still keeping
the right logic structure.