Fixed a few JSLint and JSHint errors.