Fixed a bunch of the javascript.