Bad process for handling query strings fixed

Partially resolves #370