Fix assignments to undefined variables always resolving to global