Fixed issue with invalid tag matching