Fixed metadata serialization