Fix errors spotted by JSHint

Apply coding conventions for JavaScript

Change-Id: I3d5d5182c55bf5700106616216e0c778d157aa30