[js]: Fixed some issues with the JS lib