various js fixes