Fix segfault in last commit