fixes to javascript