Fix redirects, add some JS stuff