Fixed handling of query parameters