Fixing null identity lookup bug