Fix query string parsing