Fix errors in the JS example