Finalize the data collection.