Fix more leaks of variables into global namespace.

Fixes the follwing Mocha error:
  Error: global leaks detected: iRet, theatts, splits, nameobject, that