lots of fixes to socket stuff
small fixes