Clean up before submission.