This actually fixes a bug in the noise sampling code. It does not currently put back the original metadata values, so even if this patch is not accepted, this bug should be fixed.