several js fixes