Fixed Issue #122 - replaced unsafeWindow references with myWindow