Fixed lookups on multiple entites sharing code and type