Fix crash on process restart, #2187.