Data cleanup, crash prevention