Modified spectral extraction to properly handle GAIN.