fixes up some JS issues, so things should now work