change typeerror to valueerror
re-add some removed generators to simplify patch