It's been a slow-baked process, but Krispy Kreme Doughnuts (NYSE:KKD) continues to awaken from its sugar coma. Its malady stemmed largely from its own overindulgences in store expansion, along with its troublesome relations with franchisees. But judging from the first-quarter results it released yesterday, the latest management team has a firm grasp on how to get Krispy Kreme back on the path toward consistently positive financial performance.

Posting positive earnings is a definite step in the right direction, and that's just what Krispy Kreme did for the quarter, as diluted earnings per share hit $0.06. That nearly covers the $0.08 that the only sell-side analyst covering the stock these days expects it to earn this entire fiscal year, in a demonstration of just how un-sweet the expectations and interest are for Krispy Kreme these days.

But other than the bottom-line surprise and yet another quarter of positive cash-flow generation, which served to send the stock up more than 21% so far this week, Krispy Kreme still has work to do in convincing investors that it's firmly on the sweet path to consistency. Total sales still fell 6.6%, as international growth failed to offset continued challenges here at home.

Management doesn't expect turnaround efforts in the U.S. to gain "meaningful traction" for another 12 to 24 months. It's focusing on improving franchisee relations, along with the negative same-store sales that still afflict Krispy Kreme's systemwide store base. Those stores include retail locations that also run doughnut factories to serve "off-premise" clients such as Kroger (NYSE:KR), Wal-Mart (NYSE:WMT), and convenience stores run by ExxonMobil. Smaller satellite stores are intended to reach consumers more directly and compete head-to-head with the likes of Dunkin Donuts and Canadian-based Tim Hortons (NYSE:THI).

Rising commodity costs could quickly derail Krispy Kreme's restructuring efforts, since wheat and soybeans are key ingredients in flour and shortening. In addition, off-premise sales require a fleet of delivery vehicles that are being hit by rising fuel costs. Even so, Krispy Kreme has paid down a big chunk of long-term debt over the past year, and it's seeing success in opening franchised stores overseas, with a current focus on growth in the Asia-Pacific region. The doughnut king's not out of the hole yet, but there's an outside chance that this sour stock will turn into a sweet opportunity for investors.  

Take a bite of further Foolishness: