Fixed login redirect and database updates