Fix formatting and cose file when done rather than a series of defer requests.