Fix generation dialog and writer