misc js fixups