some fixes and optimizations of identifyByName to find tag/state/enum-value