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.
Merge pull request #252 from dugwood/patch-1

Fix syntax for jsHint