Fix segfault in debug mode.