Ok, this is definitely wrong, after these two lines both `self.orig_metadata` and `self.metadata` will be the same object with the data from `metadata`. The original code was correct.