When Justin and Kate Treher purchased their stunning, 4-bedroom Tudor in Harrisburg, PA, in June 2010, they were relieved. After a long search, they thought they’d found their dream home — located in a quiet, wooded area with a spacious layout and generous yard that “seemed perfect” for raising their children.

“Most importantly, we liked that it did not need any work,” Justin Treher told AOL Real Estate. “We had no interest in changing anything, not even the paint scheme.”

But, like the old adage goes, if it looks too good to be true, it usually is: Just eight months after their purchase, the Trehers found themselves knee-deep in problems.

The couple’s “finished” basement became entirely flooded when their sump pump failed. Although the previous owner supposedly had just installed and tested the existing sump pump — and had not declared any previous water problems — before the sale, the Treher family found themselves not only with a soaked basement but with draining issues throughout the entire home. (The real estate disclaimer given to the Trehers before purchase listed no issues with the home other than upgrades and repairs that had supposedly already been completed.)

Just weeks after the discovery, the Trehers also found termite swarms in their “professionally done” sunroom. Despite a previous inspection turning up no signs of termites, the Trehers were suddenly forced to shell out an additional $2,000 to have their new home treated for the pests. Even still, their sunroom did not “seem right” after the extermination, Justin said.

“I kept noticing a musty smell in the sunroom,” he recalled. “When probing along the window, my finger went through the sill and out crawled hundreds of termites.”

The Trehers soon discovered that there was no caulking — which keeps out moisture — around any of the windows and that the home’s insulation could be seen from the outside. They ultimately had to tear down a wall and take out windows and flooring, as the sunroom turned out to be entirely soaked and mold-ridden.

As if that weren’t enough, a few months later, the frustrated Treher family also discovered a serious crack that developed alongside an existing repair line in the ceiling of their living room. Within days after the discovery, the ceiling became almost entirely detached. (When the Trehers attempted to remove the ceiling in order to replace it, it took “just one tug” for the ceiling to detach in its entirety). According to the Trehers, the house was “literally unraveling itself” — and continues to do so, even two years later.

“After the issues started mounting up, the house has never felt like home,” Justin said. “[But] we are stuck and will make the best of it — hopefully saving up an emergency fund for any future repairs after we shell out for the exterior work next year.”

How to ensure you’re not buying a lemon

Though there’s no such thing as a perfect house — every home, even newly-constructed ones, will have some issue or another — the trick is to make sure the home is free of any major problems before signing on the dotted line. Like when buying anything, purchasing a home is a financial transaction and should be treated as such.

But, much like the Treher family’s case, that can be challenging for many home buyers. According to Kirk Juneau, a licensed home inspector in Washington state who is a member of the American Society of Home Inspectors, the majority of home buyers are more concerned with the “views” than the “issues.” (His thoughts are echoed by real estate attorneyJohn Braun, who said that most people spend more time test driving their cars than looking at the home they intend to buy.)

“I think a lot of people — 80 to 85 percent of people — buy emotionally, and I get that. Buying a house is a dream,” Juneau told AOL Real Estate. “I know it’s hard, but home buyers really need to separate their emotions from this transaction. Don’t look at the home through rose-colored glasses; don’t get too emotionally attached before the inspection. That’s one of the most important things I can recommend.”

Juneau recalled a case where he was commissioned to inspect a brand-new home in the Bellingham, WA, area. He discovered significant structural issues with the home. Despite noting that in the inspection report — and advising his clients against buying — his clients went ahead and purchased the property. (“Where else can you find these views?” Juneau recalled his clients saying.) A year later, his clients contacted him, complaining that their home had settled by 3 inches, a problem Juneau had predicted in his initial inspection report.

And though some home buyers just won’t listen, Braun told AOL Real Estate that the most important tip for home buyers is still to hire a trained, licensed and well-reviewed home inspector. This is absolutely necessary, Braun said, as the average home buyer is not trained to look at homes the way a certified inspector would. Ensure that your home inspector is licensed if your state requires it. (Unfortunately, only about half of states require any kind of certification or licensing for home inspectors.) Also, make sure the inspector is affiliated with a professional inspection organization, such as the National Association of Home Inspectors, American Society of Home Inspectors or National Institute of Building Inspectors.

Juneau adds that home buyers should interview their inspector on the phone for at least 15 minutes before hiring them. “Ask for his resume, ask for guarantees,” Juneau said.

Most importantly, insist on attending the inspection.

“It will take them much longer to inspect the house — they’ll have to stop and answer your questions — but you absolutely need to be there. You’ll get a wealth of knowledge and information about the home just being present during the inspection,” Juneau said. “If the inspector isn’t willing to let you attend their inspection, then that inspector isn’t for you.”

Be careful whom you trust

Also beware of inspectors recommended by the real estate agent trying to sell the home, Justin Treher warned. While the Treher family did hire an inspector to look at their home before purchasing it, it was an inspector whom they later found out their agent knew — and “knew was awful,” Treher said.

“I just remember that the inspector repeatedly mentioned how great of a condition the house was in and applauded the former owners,” Treher told AOL Real Estate. “Unfortunately, that was a veneer.”

Treher also recommended that home buyers hire a remodeling contractor to look at the property. It’s important, he noted, to have a professional inspect and dissect the home with “no relationship to the real estate machine,” particularly someone who is able to assess the quality of workmanship in the home and spot shoddy DIY attempts.

And because you can never be too sure, some poking around yourself doesn’t hurt either, according to Steve Sochacki, an Ohio-based real estate agent. According to Sochacki, a thorough visual inspection — looking out for cracks, sloped floors or failed siding with a flashlight and binoculars — is never a bad idea. Braun also advised that after your own physical inspection, home buyers should do thorough background inspections on the home. This includes asking the agent and seller many questions and reading the seller’s disclosure documents very carefully. Doing added research on the property and the neighborhood can also save home buyers future grief.

“The recent sales history of the property can give clues: a house that sells every two years like clockwork, for example, may have an annoying neighbor or some other chronic problem. Police blotters are also full of information about ‘trouble houses’ in the community, potentially including the one you are looking at,” Braun told AOL Real Estate. “Also, agents and sellers are required to disclose to potential buyers anything that might materially affect the buyer’s use and enjoyment of the home. Known physical problems, like a leaky water heater, are included in this requirement.”

Home warranties can also protect buyers from problems, particularly in their first year in their new home. Though Sochacki isn’t their biggest advocate (“I’ve found home warranties to be ineffective in many of my own personal experiences, with sellers often reneging on what they cover,” Sochaki said), many agents still recommend warranties as another way of protecting yourself.

“Although not perfect, home warranties do cover most major mechanical systems of the house and electrical, plumbing, among others,” said agent Denise Manderfield of Ohio’s Home Information Network. Warranties ensure, Manderfield said, that buyers will not have to worry about shelling out money in case basic systems in the house do not work, or if minor repairs are needed within the first year of occupancy.

I bought a lemon! What now?

If, like the Trehers, you believe that you’ve just purchased a lemon, you still have options. Depending on the reasons behind your purchase, you might even be able to get your money back.

For example, if an agent has misinformed you about the quality of a home or omitted information that might cause potential buyers to walk away, then you have grounds to sue, Braun said. Many states, such as Texas, Minnesota and New Jersey, have an action to recover from a failure to disclose a defect. (This is the case for many homeowners who have unknowingly purchased “bad” homes.) The law is very clear that the homeowner is entitled to compensation by both the real estate agent and the licensee in such a situation. But it’s still easier said than done: Treher learned that litigation is an extremely costly, time-consuming process that can be very risky.

“We did contact a couple of attorneys, but all of them stated that it really sounded like the worst of luck,” Treher said. “While proving negligence might be possible, it would be expensive between engineer and attorney hours.”

In the case in which the homeowner has not done their due diligence — he or she didn’t conduct their proper research on the home and didn’t hire a home inspector — there are even fewer options, according to Braun. Finding issues in the home that are unknown to the seller or agent is the sole responsibility of the potential buyer.

“If there’s a grave structural defect that the seller had no idea lurked under the house, that could have been caught by an inspection [that wasn't commissioned], then the buyer is out of luck,” Braun said. “In these cases, it’s too bad.”

If your house is a new construction, however, you might have another option: Check to see if the problems fall under federal construction standards violations. If so, then in Texas, so-called “home lemon laws” will give builders 60 days to fix defects that are a serious safety hazard. If these construction defects cannot be fixed, then the builders are required to buy back the home. (These laws are in the process of being enacted in states such as New Jersey, Arizona, Massachusetts, Florida, California and Nevada).