Fix bug when optional tags attribute is missing