When it comes to U.S. consumers there are three things companies should never mess with–their pets, stomachs and kids. Thanks to poor oversight in factories in China, corporate America messed with all three in 2007 and paid a hefty price for doing so.

It started with pet food. To boost protein levels in pet food bound for U.S markets, Chinese factories added melamine, a chemical used to make fertilizer. That chemical was blamed for the deaths of hundreds of pets in March. Then reports surfaced that some foods imported from China were unfit for human consumption.

The coup de gr??ce, though, was the toxic paint fiasco. During the course of the summer, American companies recalled millions of Chinese-made toys that were tainted with lead paint. The hardest-hit company was Mattel, which recalled 21 million toys. The cost of those recalls–and the pursuant litigation from consumers and shareholders–has yet to be calculated. But because it’s hard to prove these defective toys actually hurt anyone, Mattel most likely will emerge relatively unscathed.

The more significant cost to companies such as Mattel, though, is the realization that outsourcing to China is not as profitable as they once believed.

“For years American companies have been turning a blind eye to the problems of importing products from China,” says Dan Harris, partner at Seattle-based Harris & Moure and author of the China Law Blog.

This has been a wake-up call. Companies are going to have to spend a lot more time and money testing and monitoring the quality of these products.”