Fixed wrong enum being used to check alphagen value.
CGEN_WAVEFORM is not the same as AGEN_WAVEFORM!