fix file-name-as-directory causes an error with nil argument