Updated from 5:51 p.m. ESTHandheld-computer maker Palm ( PALM) swung to a profit in its fiscal second quarter, in large part thanks to an insurance settlement. Excluding the gain, the company still managed to post a narrower-than-expected loss, citing product launches ahead of the holiday shopping season. Palm posted net income of $3.5 million, or 12 cents a share, according to generally accepted accounting principles, compared with a net loss of $25.2 million, or 89 cents a share, in the same period last year. Earnings-per-share figures have been adjusted for a 1-for-20 reverse split. Despite an overall strong launch of a new line of handheld computers, sales slipped 9% to $265 million from $291 million in the same period last year. The company said sales improved 54% over the prior quarter. Wall Street analysts polled by Thomson Financial/First Call expected the company to report a loss of 15 cents a share, on revenue of $251.54 million. Excluding costs associated with the anticipated spinoff of Palm's software unit and restructuring charges, the company reported pro forma net income of $5.7 million, or 19 cents a share, compared with a pro forma loss of $36.6 million, or $1.29 a share. Later, on a conference call, company executives noted that Palm's earnings statement for the latest quarter showed $4.4 million of interest and other income, an amount they attributed to a $5 million insurance company payment. Without that, it would appear, the company lost money in the latest quarter, although probably not the 15 cents analysts were forecasting. Gross margins improved to 32.8% from 31.4% in the last quarter. At the end of the fiscal first quarter, the company said it expects to reach a gross margin target around 35% at the end of the first second quarter. Margin improvements were primarily related to the launch of two major new handheld computers: the Tungsten T on the high end and the Zire for first-time buyers. During the quarter, the company shipped 1.4 million units, bringing the cumulative number of shipped devices since its launch in 1996 up to 20 million. Those numbers gave Palm a 60% market share in handheld devices sales for the week beginning Nov. 24 in the U.S., according to figures from research firm NPD. For the year, the company's market share remained flat at 39.4%, according to technology research firm IDC.