Fixed some minor JS issues