Fix a bug where tags were undefined