Error fixing for generator class.