Window closing improvements #2