Auth tests and fixes