Fix minor socket issues