Bug fixes on the connection polling.
Some minor design changes.