Close the file at the end.