Started using WebStorm and fixed more warnings found by that program in head.js with minor changes in other files.