Some socket fixes.