Fixed some socket issues