Fixed some JavaScript warnings

The lint feature of CloudPebble recommended JavaScript changes.