Improve IsFilename() check.