Made some changes to how pool connections can be passed through iterative queries.