Improved selecting root entity.