Some minor changes (Mostly cosmetic.); handle SEL_CLOSE message properly.