Minor changes to make login redirect logic work.