properly scan all globals, including function names, before applying them