Fix treatment of unusual filenames.