Last batch of fixes to logging in.