Fix crash in debug build