Fixes for cjs.on guard