Fixed metadata saving