More fixes to javascript