Fixed a bug with locally defined tags