enabled JSLint and fixed errors