Fixed closing TCP connections