clean globals in linkedMode.js