Better detection of invalid file names.