Applying JSHint for correctness