Fix bugs in QueryPooler.