- cleanup some socket issues and also a possible int overflow