Generator logic fixes