 The closing of the film was not scripted when filming began, so the  director (Mel Stuart (qv)) had to call David Seltzer (I) (qv)  and ask him to think of something. Seltzer came up with the "happily  ever after" bit in five minutes.