fix some sockets and make web server restartable as well.