core: Fix segfault on Debian/strectch. Thanks, pdewacht!