Fix a bunch of JSHint errors

Some JSHint errors introduced all over the place during the weekend.
Please run "npm test" before pushing.