fixed lookup in entity tests
changed queries to be typed