Fix metadata persistance