Fixed socket receiving and errors