Fix export when there are empty dirs.