Synchronize js fixes and tweaks to python