[Warning: This story contains spoilers from Sunday's episode of HBO's Curb Your Enthusiasm, titled "The Accidental Text on Purpose."]

From one idea, the "accidental text on purpose," a supersized episode of Curb Your Enthusiasm was born.

Clocking in at 40 minutes, Sunday's episode of the HBO comedy's ninth season has, so far, only been outdone in length by the premiere, "Foisted," which set the stage for the season-long fatwa storyline. This episode, however, ignored the death threat that continues to hang over Larry David's TV alter ego's head entirely. Instead, as executive Jeff Schaffer tells The Hollywood Reporter, David was back to "fighting social injustice one minutiae at a time."

Larry's latest jaunts around Los Angeles saw the show's star facing two ultimatums from "best" friends Marty Funkhouser (Bob Einstein) and Richard Lewis (playing a version of himself) that were handed down by their girlfriends — guest stars Elizabeth Perkins and Andrea Savage, respectively — who said they can no longer socialize with Larry. In both instances, he insulted the women. Also in both instances, his solutions — an accidental text on purpose and a solution to the premature "honey" — backfired and Larry ends the episode with his friendships seemingly in tact. All the while, Larry was more preoccupied with a penis-drawing bandit who kept vandalizing his dirty car in hopes he would take it to the car wash.

Below, Schaffer shares behind-the-scenes tales from the episode — including the creative process behind the penis drawing and the show's two very L.A. storylines — reacts to David's Saturday Night Live monologue being branded "controversial" and teases recurring star Lauren Graham's arrival next week.

This was the longest Curb episode yet since the premiere. When creating the season, was this when you realized you had to talk to HBO about pushing the episode lengths?

Usually, the outlines are about 10 pages. This episode was 12 or 13 pages. When we were shooting, I kept telling Larry this episode was never going to cut down to 30 minutes and yes, this was the show where I told Larry he was going to have to talk to somebody at HBO about the lengths. I didn’t want to shoot it all and then have to edit it down. We could either cut stuff before we shoot it, or we could shoot it and he could tell somebody this show was going to be long. But just because he and I had that conversation, doesn’t mean Larry actually had the conversation with HBO until after we finished shooting. (Laughs.)

Can you take me through the process of having so many ideas — the accidental text, the premature “honey,” the selective heeding of a doctor call — and how you end up bringing them all together?

This show started with the "accidental text on purpose." Everyone has gotten texts that weren’t met for them, but Larry’s genius is to manipulate the person on the receiving end. I just want to apologize right now if there was anyone out there who was routinely doing this: I am so sorry that we ruined your scam. You have about a week to get all of your accidental-on-purpose texts in before everyone has watched the episode. But we really wanted to do that idea and we knew that was an idea that could jump from story to story. Just like in life, when you hear about a good scam, the first thing you do is say, “Why didn’t I think of that?” and the next thing you say is, “I’m going to do that.”

The second thing that the show started out with was the doctor not heeding the call. Larry has had that idea for a little bit, and that was the whole reason we were on a plane. We rarely go on a plane so once we did, we wanted to pack it full of more plane stuff. The show is longer because that plane segment is almost half a show. Plane sets are sort of expensive. We had to go out to Ontario International Airport to shoot and we wanted to fill the day. That led to all the really funny stuff with June Diane Raphael. Those two stories started it, and then the next thing was the water, which had happened to Larry in a house of a person to be unnamed.

When he was served unfiltered L.A. water, did he say something to the host?

When it happened, he definitely said something to me. Whether he said something to them I’m going to leave unanswered. There are two very L.A. stories in this show and they are both about water. One is tap water. For most people in L.A., giving them tap water is like you are giving them poison. And then the second was the dirty car. Having a dirty car in Los Angeles is like ordering a beer at a business lunch, it’s just not done. People want to know what is wrong with you, economically and psychologically, that your car would be dirty. If you have one, you are less than.

Did you toy with options for who the car culprit was going to be?

There were still stories we trimmed out of this episode. There used to be a thread in the show that Larry had not seen the end of Arabesque and didn’t want anyone to ruin it. We had an alternate ending where at the end of the episode, he came out and in the dirt on his car was the ending spoiled for him. But then we realized it was too many stories and once we put the penis on the car, it was sort of done. It’s hard to top — in Funkhouser’s words — a “14-foot cock.” It’s actually pretty difficult to keep a cock car looking its best during a rainy L.A. winter. We had to always make sure the car was in a safe garage. We had to keep replenishing the dirt and redrawing the penis — it was a real endeavor.

Whose penis drawing ended up winning out? It's funny that Netflix's American Vandal also centered an entire season around a similar question.

I think it might be [the episode's director] Larry Charles’ shaft drawing and my balls drawing. We had a practice session with the car, because we wanted to see which side was going to have the drawing and which one would have all the swear words. It’s a pretty small car. So we brought the car into our offices and all took turns writing terrible words and insults to Larry and drawing penises. That was what I got paid to do that day. When you’re drawing a giant penis, there has to be a lot of consideration taken for what the balls are going to look like, or if there are going to be any balls at all. It turns out, especially for drawing something, the balls really make the penis. Without it, it could just be a stick with a lump at the end. All of these iterations were examined closely.

Then you had the girlfriend storylines. What was the inspiration for Elizabeth Perkins’ character, and what was it like to watch her spar with David?

We had such a great guest cast in this episode. Andrea Savage was so funny. Ed Begley Jr. was a hoot. June is one of the funniest people around, and then Elizabeth Perkins was such a great, steely foil to Larry. We wanted Funkhouser to have a girlfriend that he was both a little bit in love with and also a little afraid of. We wanted to make sure that we never felt sorry for Elizabeth’s character, Marilyn, so we took great pains to make her steely and finicky. That’s why right off the top, she kicks Larry off the arm of the chair. We wanted to make sure no one was going to feel sorry for her when Larry started calling her out about her tap water. But she and Larry, boy, they got into it. She was matching Larry blow for blow. We have not seen the last of her. She and Funkhouser are having a rough patch and, like all relationships on the show, the rough patch was caused by Larry. But Funkhouser really likes her, so they’re going to try again.

Funkhouser (Einstein) seemed like he was being taken hostage when agreeing to his girlfriend’s ultimatum. Would he ever be able to stick with dropping Larry as a friend?

This was Funkhouser’s worst dilemma. He thinks Larry is his best friend. Larry doesn’t reciprocate, but that’s never stopped Funkhouser from thinking this. So the choice between his best friend and his girlfriend who he really likes was just so difficult. You could see the emotion on his face, and that’s why we wanted to make sure Larry was busy doing something else, like fixing his shoelace, when Funkhouser came in. As Funkhouser pours his heart out, the shoelace seemed so perfect because it’s so tiny and, who cares? Would Funkhouser have been able to follow through and never speak to Larry again? He would have tried, but it would have killed him. There’s a lot of really fun dynamic between them this year, and it’s going to continue.

How were Andrea Savage and David in their scenes together, particularly when she watched him undress?

The other thing we did keep alive in this episode was the story of Larry’s pants. He had pants with a short fly and that’s why he ends up at Barneys purchasing new ones with Andrea Savage, who won’t leave the dressing room. We initially talked about that story as a female nurse who doesn’t leave as Larry is putting his gown on, but we decided it was much funnier in a dressing room and it tied in the hero’s journey of getting a pair of pants that he can actually pull his penis out of. Andrea was amazing with Larry. Just her blank expectant stare watching him as he’s starting to unbuckle the belt. And I have to say, the look that Larry gives as he is slowly pulling his pants down just cracks me up, because it seems to me like the look dogs give you when they are pooping: “I can’t believe you’re staring at me while I’m doing this.”

What was on the white board when you plotted this episode that ended up changing?

There was one other thing we cut that you’ll see online. A very funny scene of Larry doing a water taste test to prove that he’s an aquaphile. Where you can see that Larry can tell the difference from everything from Voss to Arrowhead in a plastic bottle. It’s a real skill of his: Larry David, aquaphile. And another little thing that became a tricky thing was getting the rights for Arabesque. Larry loves Sophia Loren and really wanted it to be her throughout the show. But to use those clips, we needed everyone to sign off. They’re old movies and it’s hard to track people down, but we always figure it will all work out. Now we’re in the middle of shooting the episode and we still don’t have permission. Luckily, my wife knew Sasha Alexander, who is married to Sophia's son, Eduardo Ponte. Larry got on the phone with Eduardo and pitched everything to him. He was a huge fan and she was happy and we got everything done. But like with Salman Rushdie and some big stuff coming up in the season, we had no plan B. We are dumb, but we are consistent!

Larry had a lot of wins, and he actually helped people like Richard Lewis, in this episode. Veep showrunner David Mandel has spoken about giving Selina Meyer (Julia Louis-Dreyfus) little victories every now and then amid the torture. Is that how you feel about Larry? Does he need to be right, even when he’s so wrong, sometimes?

The main thing about Larry is that even when he is acting wrong, he usually is right. He’s fighting social injustice one minutiae at a time. It’s nice to see him win sometimes, and it’s also fun to see him use his powers for good and not evil. It doesn’t mean it’s going to work out, but it’s nice to see him try. That was the thing at the end with the dirty car. It’s really a story about one-upmanship. At the end, it just felt right to have a “I respect your skills” nod. It’s two people who have played a game to the best of their abilities and you just see respect, which I thought was the funniest way to end that. Two people who fought a battle to the best of their abilities.

This was the second episode in a row that ignored the fatwa. Why did you choose to ignore it these two episodes?

The fatwa is still there. Just like background radiation from living too close to a powerline, it’s always going to be there for Larry and it hasn’t gone away. He’s just been following Salman Rushdie’s advice and living life a little bit. But I can assure you that the fatwa will come back in a very large way. Soon.

Will next week see Lauren Graham entering the picture, as the woman Susie Greene (Susie Essman) wants to set Larry up with on a date?

Yes. Next episode we will see Lauren Graham’s character, who is a good friend of Susie’s and who happens to be an NBC censor. We all know Larry’s track record with censors, and now he gets to go on a date with one.

David was on NBC's Saturday Night Live this weekend and his monologue received mixed reviews. There was a fair share of Twitter users who said, “Clearly anyone offended has never watched an episode of Curb.” Do you think SNL and Curb audiences are just different?

I thought he was great and that the show was very funny. But I don’t know, that’s a good question. I thought that was a really funny joke. There are many things I’ve been wrong about — like who’s going to win a football game and who is going to win an election. But on this, I’m quite sure I’m right. That was a funny joke. That’s sort of it. And if some people don’t like it, who cares?

Curb, like David did in the opener, has joked about the Holocaust. Season four's “Survivor” episode is a common fan-favorite moment in the series. How do you approach finding the funny in topics that many others wouldn’t touch, something you do often on Curb?

I wasn't on Curb yet for the "Survivor" episode, so I watched it as a fan and I thought it was brilliant. I know Larry has said that he spent more time editing that scene than any scene he’s ever edited, just because he wanted to make sure he got it right. And he did, it’s hilarious. There’s no topic that’s off-limits, it’s all how you do it. For me, I’m not going to start dulling every edge because someone got offended. If you don’t like it, don’t watch. We are totally cool with that.

Was there any episode this season where you felt like you had to pay extra care to get it right?

The thing about an improv show is that you are always trying things. The takes of the day are littered with aborted experiments; things that were funny but not right for the show. You are always trying things. You can’t ever censor yourself because you want a set where these brilliant improv actors always feel free to try anything and are never going to be judged for it. They trust us that we’re going to go into the edit room and keep the best and the funniest things and not leave anything that would be either unfunny or too far. That’s the trust that needs to happen on an improv set, and that’s why you get all these great actors who want to come and play, because they feel like they are always going to be supported and know they aren’t going to get hung out to dry if they try something that didn’t work.

There is also a Curb playlist floating around, claiming to have been curated by David for Spotify. Did you have any involvement in that?

Larry loves making playlists. He makes playlists for me all the time. Mixes I really enjoy. He always feels like that’s the best way that he expresses himself. Sure, he’s got a TV show, but the real way he expresses himself is through playlists. If these interviews go very well, perhaps he will grace you with one.

What did you think of the sixth episode of Curb Your Enthusiasm's ninth season? Tell THR in the comments below, and check back with Live Feed for weekly chats with Schaffer as the season airs Sundays at 10 p.m. ET/PT on HBO.