Fixed reading of query parameters