Clean up after queries.