#4137 First pass on making metadata immutable
#4137 Fix build