I'm not really convinced about your diagnosis. If you have a directory name like "Firstname I. Lastname", that whole string should be showing up (with spaces and period character) as one of the the hash keys when you split the path on slash characters. There might be something else screwy in your directory structure or file names. (Have you ever seen a line-feed and/or carriage-return character used as (part of) a file name? I have. It does nasty things.)
You can go ahead and try something besides "." for the parts in the code that use "." (or "./") as a hash key. Or, you could try renaming the directory that has your middle initial in its name, to see if that makes the problem go away. Or you could create a symbolic link ("shortcut" in windows parlance) to that directory so that you can use some other string as its path name.
In any case, I don't think there's anything more I can do here. It works for me, and I can't replicate the problem you're having. (Does it work for you on other paths, at least?)