fixed Query parser, made query dialog a bit more useable