Fixed round-robin selection of connections.

It was using the configured host names to get the connection count.