Fixed a couple of JS errors