Better backwards compatibility for QueryObject::count()