Fix query string parameter handling in test environment