Try to solve java.net.SocketException
Some fixes