bugfixes, cleaner sockets