Bug correction in filename generation