Check if folder exists in tagging

Fixes #3069