Updated entity lookup to allow explicit NULL values