Fix a couple of minor bugs in login