Fix segfault related to authentication