Fix crash creating new user during initial login. Add test.