Fix check for undefined 'window' global var.
Fix check for undefined 'window' global var.

May be necessary if not running in a DOM environment.

junlapong/smoothie,mcanthony/smoothie,stanlry/smoothie,stanlry/smoothie,mcanthony/smoothie,junlapong/smoothie