Fix code disobedient to strict mode in tools/tools.js