Fix syntax for jsHint

Fixed some lines or changed some code to validate the code against jsHint. See http://www.jshint.com/. Thanks for the good work.