Workaround for crash on hangup.