minor fixes in js