Remove calls to UnsafeWindow

Objective is to remove all warnings f