Various small js fixes