Various minor fixes to get the authentication to work