Bug fix to allow query to run on entire dataset.