Fix issue with unsafeWindow.