Fix global leaks in query_string, response