Fixing a bug in role tag handling where only the first tag was used

Fixes #6517