Fix the count() impl to use buildWhere() from the subclass

/to @ritch 
/to @bajtos