JavaScript: Fixed issues reported by JsHint