Misc js fixes