The "if(!(node[1] in localVars))" guarding additions to nonLocalVars is supposed to prevent this, but your suggestion sounds more robust.  FWIW this whole check may not be necessary if we're sure the register names cannot collide with globals, I just added it to sanity-check things during development.