Cleanup and add headers.