Making sure file names are valid