Properly escape the weirdly URL-encoded queries, fixes #1