Various fixes in the js for multi-backend