Fix crash in private threads.