More work on the connection polling.

And some minor design fixes.