small fixes to the javascript