Better fix for #5725 since this was also happening in directory and symlink stanzas.

The last pull request missed the same issue happening in directory/symlinks as well. This fix covers the other cases in manage_mode directly.