Fix query string issues