Fix that logout of unauthenticated users throws exceptions