Fix metadata setting