During the War of 1812, Van Buren worked with Clinton, Governor Tompkins, and Ambrose Spencer to support the Madison administration's prosecution of the war. In addition, he was a special judge advocate appointed to serve as a prosecutor of William Hull during Hull's court-martial following the surrender of Detroit. Anticipating another military campaign, he collaborated with Winfield Scott on ways to reorganize the New York Militia in the winter of 1814–1815, but the end of the war halted their work in early 1815. Van Buren was so favorably impressed by Scott that he named his fourth son after him. Van Buren's strong support for the war boosted his standing, and in 1815, he was elected to the position of New York Attorney General. Van Buren moved from Hudson to the state capital of Albany, where he established a legal partnership with Benjamin Butler, and shared a house with political ally Roger Skinner. In 1816, Van Buren won re-election to the state senate, and he would continue to simultaneously serve as both state senator and as the state's attorney general. In 1819, he played an active part in prosecuting the accused murderers of Richard Jennings, the first murder-for-hire case in the state of New York.