Fix crash when tagging