Query fix

ping @emersion
ping @elfet

I believe this PR fixes the query parameter bug you had.