Fix for case where global is non-enumerable

  * At least Classic ASP seems to throw errors on attempts to enumerate
    the global object. Made small modifications to bypass errors or to
    throw a more comprehensible exception if it cannot be avoided.