small fixes in javascript