Example code was referencing non-existing object

Noticed two small errors in example code of the Javascript manual.