Added program exit to frame closing.