Fixed handling of directories returned by the glob of the file paths