Window closing improvements #3