Patch 1

Fixed an error and added the change to the javascript version. Let me know if you put it up on boromir.toolness.org!