fixed potential error when creating a metadata as a copy of another.