Fixed a bug in the tag parsing