Improve connection coercing code to better support sharded connections