Fix ConnectionClosedError.