Net gains on investments, before taxes, totaled $19.7 million in 2017 compared to $23.2 million during 2016. Direct trading gains during 2017 were $8.2 million lower compared to the prior year. Other-than-temporary impairments of $0.4 million, netted with gains of $1.6 million on previously impaired available-for-sale securities that were sold in 2017, are included in the net gains stated above. Investments in limited partnerships produced gains of $12.5 million in 2017, compared to gains of $2.5 million during the prior year. Limited partnership investments utilized by the Company are primarily engaged in long-short equities, private equity, country focused funds and real estate development as an alternative to direct equity investments. The aggregate of the Company's share of gains and losses in these entities represented a 16.3% appreciation in value for 2017, compared to a 3.3% increase in value for 2016.
To the Shareholders and the Board of Directors of Baldwin & Lyons, Inc.
The unrealized net gains or losses (net of applicable tax effect) related to equity securities are reflected directly in shareholders' equity, unless a decline in value is determined to be other-than-temporary, in which case the loss is charged to income. In determining if and when a decline in market value below cost is other-than-temporary, an objective analysis is made of each individual security where current market value is less than cost. For any equity security where the unrealized loss exceeds 20% of original or adjusted cost, and where that decline has existed for six months, the decline is treated as an other-than-temporary impairment. Additionally, for any equity security where the decline has existed for a period of at least one year, the decline is treated as an other-than-temporary impairment. Additionally, the Company takes into account any known subjective information in evaluating for impairment, without consideration of the Company's quantitative criteria defined above, as well as the Company's intent and ability to retain the equity security for a period of time sufficient to allow for such recovery in fair value.
The Company utilizes the services of investment firms of which two directors of the Company are employees or partial owners. These investment firms manage equity securities and fixed maturity portfolios with an aggregate market value of approximately $24,779 at December 31, 2017. Total commissions and net fees earned by the investment firms and affiliates on these portfolios and for advice and consulting were approximately $97, $207 and $235 during 2017, 2016 and 2015, respectively.
During 2015, the Company entered into a consulting contract with an insurance brokerage firm of which a director of the Company is CEO and a Managing Director. The consulting contract provides for an annual fee of $300. For the years ended December 31, 2017 and 2016, the Company incurred expenses of $300 and $300, respectively, related to this agreement. The Company also has a brokerage agreement with this entity. The Company incurred commission expense in connection with insurance policies written in 2017 and 2016 under this brokerage agreement. Total commission expense for 2017, 2016 and 2015 was $674, $419 and $0, respectively.
In accordance with the terms of the 1981 Stock Purchase Plan (the "1981 Plan"), the Company is obligated to repurchase shares issued under the 1981 Plan, at a price equal to 90% of the book value of the shares at the end of the quarter immediately preceding the date of repurchase from one outside director. A limited number of shares have ever been repurchased under the 1981 Plan. At December 31, 2017, there were 46,875 shares (Class A) and 187,500 shares (Class B) outstanding which remain eligible for repurchase by the Company.