Corrected bug causing segfault on large sites.
Expects that this was caused by iterating over all elements rather than getting the global object from ExecState