Cleanup on code running through CLI sync()