Fixed some bugs with new getQuery/getHash functions