Patch to EPI to prevent memory leaks