Switched to jshint and fixed most issues.