Fixed connection pooling

Code to generalize connection pooling did not properly tend to pointers