Fix errors spotted by jshint