Fix automatic expiry of queries.