Fixed issue with invalid tag matching when content is selected