Fix errors mentioned by JSHint
Merge pull request #1405 from opf/fix/8449_fix_js_errors

[Fix] 8449 Fix JS errors