Fix metadata overwrite