Fixed a bug in the JavaScript implementation.

One of the internal functions was not properly referencing the internal schema. This has been fixed.