year (determined without regard to this section) exceeds the entity’s net capital gain for such year determined with regard to this section, and (ii) there shall be other appropriate adjustments (including deemed distributions) so as to ensure that the benefits of this section are not allowed (directly or indirectly) to corporate shareholders of qualified investment entities. For purposes of the preceding sentence, any amount includible in gross income under section 852(b)(3)(D) shall be treated as a capital gain dividend and an S corporation shall not be treated as a corporation. (C) Exception for qualification purposes This section shall not apply for purposes of sections 851(b) and 856(c). (D) Exception for certain taxes imposed at entity level (i) Tax on failure to distribute entire gain If any amount is subject to tax under section 852(b)(3)(A) for any taxable year, the amount on which tax is imposed under such section shall be increased by the percentage determined under subparagraph (B)(i)(II). A similar rule shall apply in the case of any amount subject to tax under paragraph (1) of section 857(b) to the extent attributable to the excess of the net capital gain over the deduction for dividends paid determined with reference to capital gain dividends only. The first sentence of this clause shall not apply to so much of the amount subject to tax under section 852(b)(3)(A) as is designated by the company under section 852(b)(3)(D). (ii) Other taxes This section shall not apply for purposes of determining the amount of any tax imposed by paragraph (4), (5), or (6) of section 857(b). (2) Adjustments to interests held in entity (A) Regulated investment companies Stock in a regulated investment company (within the meaning of section 851) shall be an indexed asset for any calendar quarter in the same ratio as— (i) the average of the fair market values of the indexed assets held by such company at the close of each month during such quarter, bears to (ii) the average of the fair market values of all assets held