California Pizza Kitchen (NASDAQ:CPKI) released preliminary second-quarter figures about a month ago. The market didn't like the numbers then, and it likes the final numbers even less, treating the underlying stock to as much as a 9% thumping in recent trading. What gives? I'll explain.

CPK's second-quarter results were simply outstanding, especially in light of what has been a very tough operating environment for many casual diners. On the revenue side, net sales and comps increased 16.4% and 5.4%, respectively. Perhaps even more impressive is that despite escalating commodity prices, where dairy products in particular have risen sharply, CPK actually managed to improve restaurant-operating margins by 20 basis points. The company went a step further and was able to leverage G&A expenses to squeeze out about 40 basis points of additional margin improvement.

The company should be proud of the solid comps growth and improvements to restaurant operating margins, as it is in rare company. Just yesterday I highlighted a handful of struggling restaurateurs -- like Brinker (NYSE:EAT), Applebee's (NASDAQ:APPB), and O'Charley's (NASDAQ:CHUX) -- that would love to be CPK's position right now.

More good news came when the company announced yet another share buyback program, this one totaling $50 million, the company's largest to date. In its previous plan that ended on Aug. 2, CPK bought back over 2.6 million of its own shares at an average price of $18.61 per share. Yep, that's about where the stock is trading right now after the latest shaving by the market. You can bet that if the stock stays at these levels for long, the company will quickly put its newest buyback program to use.

With all of this positive news, you may be wondering what has the market's knickers in a twist. Well, investors didn't like what CEO Rick Rosenfield had to say in the quarterly conference call. More specifically, it was his remarks regarding July comps that alarmed investors. Comps in April, May, and June came in at 6.5%, 4.8%, and 4.8%, respectively. Then in July they slipped a bit, down to 3% -- but this was still positive. The good news is that the early numbers coming out of August put comps back to around 4.7%. The bad news is that because of this recent volatility, management felt it necessary to be "more conservative about the back half of the year."

Sometimes the market just overreacts. This is one of those times. With this recent gift from the market, I would be taking a closer look at the company in the coming days.

Grab a slice of related Foolishness:

Fool contributor Jeremy MacNealy has no financial interest in any company mentioned. The Motley Fool has a disclosure policy.