Reset the cuda/PMU on the iMac. Depending on your model (if its first gen you got to take it apart), you can open the flap where the RAM is installed on the bottom. There should be a small silver square with a black button near the battery. Unplug it from the wall and press and hold in the button for approximately 1 second, no longer no shorter. Then let it sit there un plugged for about 3 minutes. Then plug it back in and power it back on. That should do a factory reset on the power management built into the firmware.