minor js fixes
Merge branch 'fix-js' into closeio