Fix handling of auth errors