Tweaked networking code (closing connection).