Updated for exists_series dirs_only parameter, if entry is a dir, don't chop the last word from the name.