Fixed some major memory bugs inside the socket lib, memory leakages are 1/4 since the last commit