What act was put in place during the Napoleonic wars and the war of 1812