Fixed handling of query parameters

@sheavalentine-mdsol Please merge this patch.