Many socket fixes