Workaround for crash at exit