Fix JSHint and JSLint complaints