Rick realizes the prisoners cannot be at fault and lets them lead him to the generator room. There they find Andrew (Markice Moore), whom Rick had left for dead, as the instigator. Andrew is about to kill Rick when Oscar shoots him, and then turns the gun over to Rick. They stop the generator and disable the alarm. Elsewhere, Carl (Chandler Riggs) covers for his mother Lori (Sarah Wayne Callies) and Maggie (Lauren Cohan) as they take shelter in a boiler room. Lori has gone into labor, but is bleeding profusely during her contractions, thus unable to give birth properly in the boiler room. Lori demands Maggie perform a lethal Caesarean section to deliver the child, knowing it will kill her, but would rather die knowing her baby will live. The baby is delivered safely, but Lori dies; Carl takes a moment to mourn before shooting her in the head to prevent reanimation. With the walkers dealt with, the group rejoins in the courtyard, though Carol is still missing. Rick sees Carl and Maggie emerging from a cell block with the baby, but realizes Lori is not with them, and becomes hysterical. "Killer Within" was written by Sang Kyu Kim. Guy Ferland directed, his second such credit for "The Walking Dead" third season. Ferland previously directed episode 3, "Walk with Me". "Killer Within" signified the final appearances of Sarah Wayne Callies (Lori) and IronE Singleton (T-Dog) as regulars. Although Callies suggested Lori's death to Frank Darabont on numerous occasions, Glen Mazzara made the decision to kill her off. The writing team chose to advance the revelation into the earlier part of the season, to provide "fresh" opportunities for the staff. Mazzara and Callies conversed minimally about how Lori would die, but Callies opted to wait until the script's release to acquire more insight, since her character "doesn’t know she’s going to die". She rehearsed and revised the dialogue with Mazzara for a couple of weeks. Some of the adjustments, Mazzara said, weren't initially in the script. "I just thought, it belongs there," Callies stated. To prepare for the death scene, Callies viewed the Stanley Kubrick-directed war film "Full Metal Jacket" (1987) with Ferland. She liked Arliss Howard's performance and described his character's demise as a brisk, "kind of strange death".