Ran JSHint and made a few fixes