Cleanup before ri-execution