Fix small errors in JS