minor fixes in JS file