Fixed generator onFlush checking issue. [ci skip]