Fixed bugs re. whole form closing