Fix to EntityNameMatchResult, code clean up