Ensure pool.getConnection retrieves good connections

fixes #434
fixes #557
fixes #778