Fixes sockets and improvements