Remove unnecessary semicolons
Use local variables in for loops
Fix typo in variable name
Merge pull request #602 from Madrigal/js-minor-fixes

Js minor fixes