Fixed bug in generator examples