fix query logic to only give 'totalLimit' results when batch size > totalLimit
fix query logic to only give 'totalLimit' results when batch size > totalLimit

dwhjames/aws-wrap,liruqi/aws-wrap,dwhjames/aws-wrap,liruqi/aws-wrap