Improve tag matching behavior