Fix ASAN crash (needs another look)