Fix socket issues