FIX: putting back missing changes to support encapping.