Fix for detecting `window` when running in node.