Fixed a couple bugs, cleaned up some JS and HTML.