Allen's first cut was deemed to be decidedly unfunny, including his death scene in a slow-mo hail of bullets, like Bonnie and Clyde. Producers Jack Rollins and Charles H. Joffe convinced him to sit with top editor Ralph Rosenblum to see what could be salvaged. The first thing Rosenblum did was cut out the gory ending, then he restructured the film completely, and generally tightened up Allen's loose narrative. This effort transformed the finished film into a comedy classic. Rosenblum subsequently became Allen's editor of choice on most of his next films, including Bananas (1971), Sleeper (1973), Love and Death (1975) and Annie Hall (1977).
One hundred San Quentin prisoners were paid a small fee to work on the film during the prison sequences. The regular cast and crew were stamped each day with a special ink that glowed under ultra-violet light so the guards could tell who was allowed to leave the prison grounds at the end of the day.
Filmed for 10 weeks in the San Francisco area. Allen joked that it was a better place to spend the summer than Cleveland but, in reality, he knew that the city was compact enough to allow him and his crew to complete 87 moves in 50 days. His film crew knew that such a daunting schedule was more suited to the TV industry, where working till 10 or 11 at night was commonplace. But Allen completed the film without once working late, and several times he wrapped for the day at 4 o'clock.
This was the first movie that Woody Allen directed. His initial lack of either confidence or track record prompted him to initially ask Jerry Lewis to direct the movie, but Lewis was busy with his own work.
Allen initially filmed a downbeat ending in which he was shot to death, courtesy of special effects from A.D. Flowers. Allen's editor, Ralph Rosenblum (whose first work with Allen this was), convinced him to go for a lighter ending.
The "Spring Street Settlement House Marching Band," with which Woody Allen attempts to play cello in an early scene, was really the marching band of Tamalpais High School in Mill Valley, California, just north of San Francisco. The band had received an invitation to perform at Disneyland in a festival of high-school bands and the fee they received from the film helped to pay for their trip.
Virgil's inept attempt to escape prison by carving a gun out of soap and turning it black with shoe polish is loosely based on real life bank robber John Dillinger's famous escape from the Crown Point, Indiana jail using a wooden gun blackened with shoe polish. In an interesting parallel, in the film Dillinger (1973) directed by John Milius and starring Warren Oates as John Dillinger, he is shown using a bar of soap instead of a piece of wood.