Various fixes for non-local saving of metadata