Have you tried putting one or more dots after a filename or directory? You can't.
If no characters follow these fullstops, it is presumed the file has no extension and the periods are removed/ignored.
Try this experiment:
$isfile $isdir are handling this appropriately and should not be changed.