Funeral for a Fiend

"Funeral for a Fiend" is the eighth episode of "The Simpsons"' nineteenth season. It first aired on the Fox network in the United States on November 25, 2007. It was written by Michael Price and was directed by Rob Oliver. It features Kelsey Grammer in his tenth appearance as Sideshow Bob, as well as David Hyde Pierce in his second appearance as Cecil Terwilliger. John Mahoney makes his first appearance as Dr. Robert Terwilliger, Sr., the father of Bob and Cecil. Keith Olbermann also makes a guest appearance as himself.
Plot.
The family see a TV commercial for a new rib restaurant called Wes Doobner's World Famous Family Style Rib Huts, owned by a cowboy named Wes Doobner and perfectly suited to each member of the family. They decide to visit it for its grand opening, but discover Doobner is really Sideshow Bob, who created the restaurant and added subliminal messages to the commercial to lead the Simpsons into a trap. After tying up the Simpsons, Bob then reveals a large pile of TNT, with which he will kill them, using a laptop with a defective battery (which will overheat and explode) as a detonator. While gloating, Bob incorrectly quotes a phrase from "Macbeth" and Lisa corrects him. Bob tries to look up the correct phrase on Wikipedia, but the laptop explodes in Bob's hands, and he is then arrested and taken to court.
During Bob's trial, Bob's father, Dr. Robert Terwilliger Sr., is brought to testify. He explains Bob has a rare heart condition, and also suggests that Bob is insane because of his long-standing feud with Bart. Since all of the audience have been tormented by Bart's pranks, Bob convinces Springfield that in the long-run, Bart is ultimately to blame, and the people turn against him. As Bart pleads his innocence, Bob takes out a vial labeled nitroglycerin, which everyone thinks is a deadly explosive. However, as Bart throws the vial away to save the town; it is shown to actually be Bob's heart medication, and he collapses on the floor and is pronounced dead.
Bob's entire family attends the funeral: His mother, Dame Judith Underdunk, a well-known Shakespearean actress; his father; his brother Cecil, who was let out of jail for the occasion; his wife Francesca and his son Gino. Many regular Springfielders also attend the funeral. Feeling slightly guilty, Bart speaks to Cecil and decides to go to the Springfield Funeral Home to make peace with Bob's corpse before it is cremated; however, Bob rises out of the coffin, very much alive, and traps Bart in the coffin to be incinerated.
Back at home, Milhouse inadvertently makes Lisa realizes that everything was an elaborate plot put together by Bob and his entire family: with his mother being a Shakespearean actress, Bob would have known any Shakespearean play too well to have accidentally misquoted him and figures that he must have done so intentionally in order to get caught and go to trial, where his father used a special drug to make him appear in a deathlike state. Cecil helped by playing to Bart's guilty conscience and encouraging him to visit Bob's corpse, leading Bart into Bob's wrath once again. The Simpsons race to the funeral parlor and just barely manage to save Bart from being burned alive by briefly blinding Bob with unclaimed ashes. The police then arrive and arrest Bob and his family. Defeated but curious, Bob questions Lisa on how she was able to figure out his family's scheme — Lisa admits that she actually started getting suspicious when she noticed that Bob's coffin had been custom-made to fit his large feet and points out that his family likely would not have bothered paying for something like that if he was actually dead. Bob and his family are sentenced to prison for 87 years and are made to share a cell with Snake Jailbird, who constantly torments them while Bob "actually" goes insane over killing the Simpson family by imagining their deaths.
Production.
The scene where Homer blocks Marge from getting Bart out of the coffin, telling her, "He has "got" to get over his fear of coffins," is derived from the opening scene from "Tennis the Menace" where Bart gets trapped in a coffin and starts to panic. Homer watches him panic on a closed circuit TV.
John Mahoney is the third "Frasier" cast member to play a member of the Terwilliger family, after Kelsey Grammer and David Hyde Pierce, his on-screen sons in both shows.
The song Krusty sings at Bob's "funeral" is a take-off on "Candle in the Wind" by Elton John. The title of the episode is also an allusion to the Elton John song "Funeral for a Friend (Love Lies Bleeding)", the preceding song to "Candle in the Wind" on the album "Goodbye Yellow Brick Road".
The Terwilligers seal Bart in Bob's spacious coffin and turn on the conveyor belt to the cremation furnace in an attempt to incinerate him, in reference to Mr. Wint and Mr. Kidd doing the same to James Bond in the film adaptation of "Diamonds Are Forever".
Reception.
An estimated 9.0 million viewers tuned into the episode. 
Robert Canning of IGN gave the episode a 6.2/10, saying, "There were some enjoyable scenes, but the half hour lacked in the number of laugh-out-loud moments, and Bob's ultimate scheme wasn't very surprising." The website later placed the episode at #9 on the list of "the Top 10 Sideshow Bob Episodes", with Canning stating that it "returned Bob to his path of vengeance, and that's really the only factor that pushes this episode above its predecessor. Even with a return to what we know, this is still one of the weakest Sideshow Bob episodes. One major aspect of this episode is that it reunited the Crane family from "Frasier". [...] While this could have been comedy gold, "The Simpsons" wasted the opportunity. Instead of keeping the familiar dynamics these actors had shared before (a tactic that worked extremely well in Cecil's first appearance), the series took a different route, making Mahoney's father character just as uppity and snobbish as his animated sons. Add an excessively elaborate, unfunny plot to kill Bart and ‘Funeral for a Fiend’ failed to capture any of the early seasons' Sideshow Bob magic." 
Richard Keller of AOL TV said, "While Pierce and Mahoney did have their moments it was all Grammer this episode as a Sideshow Bob coming apart at the seams." He went on to say, "For the most part this week's episode was entertaining. Plus, it also brought a bit of continuity into the show, something that comes and goes on the program." 
Genevieve Koski of "The A.V. Club" gave the episode a B+, praising the appearance of Pierce and Mahoney as Cecil and Dr. Terwilliger post-"Fraiser", but criticized the TiVo storyline at the beginning, and wondered "if Lisa's recap of Sideshow Bob's plot was meant to be an homage to "Black Widower," when Bart recapped Bob's plan to kill Selma. If it was, it was half-assed; if it wasn't, it was a pleasant bit of unintentional nostalgia."