Fix problem with empty query hash