Fix misc bugs and typos in app.js