 Complete the following phrase:  When the Chilean independence movement swept the country, he joined the Royalist side. In 1812, he was named secretary of the New Appeals Court Tribunal de Apelaciones, the body that replaced the colonial Appeals Court Real Audiencia, and later became Minister of the Supreme Court of Justice. Royal Governor Francisco Marcó del Pont appointed him as his secretary in 1815, but after the 