Add support for saving chains to sample_file