Ensure pool.getConnection retrieves good connections

fixes #434
fixes #778