Redirect already logged in users to web app.

Also fix a few other bugs.