Halliburton's (NYSE:HAL) second-quarter results probably won't receive any accolades, but even as it remains embroiled in controversy, the firm has the opportunity to improve its attractiveness as an investment.

The oil-field and engineering-services outfit announced that revenue in its latest quarter jumped 38% to $5 billion versus $3.6 billion in the same period last year. At the same time, Halliburton booked a net loss of $1.51 per share, including a $0.46 charge on a troubled contract in Brazil and a $1.39 charge related to a proposed asbestos and silica legal settlement. Excluding these items, earnings would have been $0.34 per share.

While it may not seem to be a bright spot, Halliburton's asbestos write-down is a significant step in the firm's effort to put this massive liability behind it. The move also paves the way for the emergence of subsidiaries DII Industries, formerly Dresser Industries, and KBR from bankruptcy.

Halliburton's KBR subsidiary, primarily responsible for work in Iraq, continues to book new work, including a U.S. Navy contract, even as scrutiny of its dealings in Iraq continues. KBR's backlog at the end of June totaled $8.8 billion, up $400 million since March, mostly because of its contract to provide troop support services in Iraq and elsewhere. More revenue is probably on the way, since the General Accounting Office recently warned that the military has mostly burned through the $65 billion allotted for operations this year as troop levels in Iraq remain at higher-than-anticipated levels.

Still, government investigations are a cause for worry because they can lead to payment delays. Halliburton had negative free cash flow from operations of $176 million in the first quarter, on top of negative $775 million for all of 2003. The firm did not provide cash flow information for the second quarter, but long-term deficits are never good. That said, Halliburton had $2.2 billion in cash and equivalents at the end of the second quarter.

In the end, Halliburton may decide that KBR is more trouble than it is worth. Halliburton's energy services unit is enjoying solid results, but KBR is masking this performance. If, as published reports suggest, Halliburton decides to spin off KBR, most investors would probably cheer the move.

Fool contributor Brian Gorman is a freelance writer in Chicago. He does not own shares of any companies mentioned in this article.