minor fixes
Fixes count query in MySQLDocumentService