Fix an issue with focusedWindow.define not getting reset