Ran JSHint and applied fixes