Fix JS example, fixes #1