Fixed generator bug