Fix misc js errors in init.js and remove stray console.logs