Dispose of datasets and files properly.