A fix for the closed window/menu bug.