Added preliminary support for generators.