Fixing the aggregate queries that weren't exactly correct