Correctly encode query params