Added catch for breaking empty count queries.