Fix header generation when using query params.