Toyota announced Wednesday that it will fix gas pedals in millions of cars for an accelerator problem that had previously been blamed on floor mats.