Added limits for non-aggregate queries.