Various js fixes