Fix login redirects, tests