Fix some possible JS issues