fixed some generator edge cases