several bugfixes on the conenction object