Fix nested entities.