Make sure query string is always as gui

[#649]