Vice President Dick Cheney, who has a history of heart problems, had surgery to replace an implanted device that monitors his heartbeat. Doctors at George Washington University Hospital on Saturday replaced the defibrillator, a sealed unit that includes a battery. If the device were to sense an abnormal heart rhythm, it would deliver an electronic shock to reset the vice president's heart to a normal beat. "The device was successfully replaced without complication," said Megan McGinn, the vice president's deputy press secretary. Doctors did not replace the wiring attached to the defibrillator. Replacing these defibrillator wires, which thread through Cheney's heart, would have required a much more extensive operation. Cheney, wearing a sports jacket and open-collared shirt, smiled and waved as he left the hospital about four hours after he arrived in the morning with his wife, Lynne.