Fix JSHint issues

I fixed almost all of the JSHint warnings.