Fix checkstyle warnings.
Move file name generation into generator.
Save files earlier.