Fix metadata script