Fix JSHint warnings — undeclared vars, semicolons, etc.