In the scene where Sean starts talking about his dead wife and her farting antics the lines were ad-libbed by Robin Williams, which is why Matt Damon is laughing so hard. The scene took everyone by surprise. According to Damon in the DVD commentary, this caused the cameraman to laugh so hard that the camera can be seen moving up and down slightly.
“This morning, I lost my husband and my best friend, while the world lost one of its most beloved artists and beautiful human beings. I am utterly heartbroken. As he is remembered, it is our hope the focus will not be on Robin’s death, but on the countless moments of joy and laughter he gave to millions.”