A few bug fixes.

Fixed a bug in the json short code, and a couple of JS bugs.