Moved rm into block where files are generated.