More work on saving metadata.