Fixed a couple JS errors