Various fixes, mostly related to the Connection object.