Since the GOES-8 launch in 1994, unexpected values of imager calibration slopes have ben observed near satellite midnight, especially in the 'shortwave' channels 2 and 3. Concurrent imager measurements of apparently decreased ocean temperatures suggest that the slope changes do not reflect actual changes in the instrument, but rather errors in the onboard calibration process. One type of error is believed to be caused by heating of the instrument surfaces around midnight when the sun is above the equator. Reflected by the onboard blackbody, excessive radiation from these hot surfaces reaches the detectors when the blackbody look is performed during the calibration process. This decreases the magnitude of the slope, causing the earth scene to appear cooler. Another type of error is introduced by scattered solar radiation, which contaminates the instrument space- look signal around midnight during the two annual eclipse seasons. When the calibration uses the contaminated space signal, it increases the magnitude of the slope, causing the earth scene to appear warmer. Both midnight effects alter the slope by as much as 4 percent in the shortwave channels, thus leading to temperature errors of up to 1 K for a 300 K target. This paper describes a study of these effects and an algorithm to correct them. The algorithm estimates the correct slope at midnight form correlations between the slope and the temperatures of optic components within the instrument. In particular, it is found that the slope can be predicted from the telescope primary-mirror temperature with an rms error of less than 1 percent. Our study also indicates that the effective temperature of the hot surfaces may reach 360 K in the middle of summer, and the shortwave channel space look may be contaminated with radiation from an apparent 'target' with temperature as high as 250 K around the eclipse seasons.