Correct some global references in JavaScript

Change-Id: I0bf464f9014e07fe4fb6045feee33c1732e3f3be
Merge "Correct some global references in JavaScript"