fixed errors reported by jslint