Corrected reducequery.sh