Fix crash when querying for tags.