In the mid-2000s, CBS launched How I Met Your Mother, a sitcom that seemed stock by nature -with its cast of characters who were young, attractive 20-somethings in New York City who either hung out at the local bar or an expensive apartment that none of the characters could really afford. It was a tiring and overdone formula, which many believed had already been perfected by Friends.

However, the show's creators had a unique plan for How I Met Your Mother by adding an interesting mystery in the mix that would keep viewers on the edge of their seats for years to come. That mystery? Finding out the identity of the woman who would eventually become the mother of Ted Mosby's children. As the story was told from the perspective of an older Ted, fans waited patiently for a decade to find out who the mother was.

The show was an instant success thanks to its intriguing premise, lovable cast of characters, and hilarious use of cut-aways. Despite the overnight phenomenon the show became, it was plagued with setbacks, secrecy, and poorly planned decisions that proved the show had a rocky production.

With that in mind, let's take a look at 15 Dark Secrets Behind How I Met Your Mother.

15. There's A Deleted Alternate Ending

Ted holding an umbrella for Tracy as she points at him in the series finale of How I Met Your Mother

Some fans were less than pleased when the show's original ending aired, showcasing the mother ing away thanks to an unknown illness, with the show ending only to show Ted chasing after Robin again. It turns out that there was a deleted alternate ending that had a much more definitive, safer tone.

The deleted alternate ending features Ted telling his children how easy it was to find the mother, giving them essentially a "TL;DR" of the previous nine seasons with visuals depicting each beat accompanying the voiceover. The ending then takes us back to the scene where Ted and Tracy first meet and then ending as the train arrives.

Many fans wanted this specific ending, though it makes sense that this ending was scrapped to cater to the Robin and Ted romance that the creators had planned from the very beginning.

14. Jason Segel's Smoking Was Too Much

Jason Segel as Marshall and Alyson Hannigan as Lily on How I Met Your Mother

Jason Segel played Marshall Eriksen who was married to Alyson Hannigan's Lily Aldrin, so naturally, they shared a few on-screen kisses together during their tenure on the show. However, Segel was an avid smoker who would light up between takes, which meant that he always smelt and tasted like an ashtray.

Hannigan refused to kiss Segel and asked her co-star to quit smoking, which is a huge ordeal for any long-term smoker. Segel and Hannigan came up with a system where Segel had to pay her $10 for every cigarette smoked, but as one can expect, he ended up having to pay quite a bit. In the end, Segel obliged by quitting smoking. However, his smoke-free life only lasted a year, as he relapsed due to stress.

13. Jennifer Love Hewitt Turned Down The Role Of Robin

Jennifer Love Hewitt looking up in Ghost Whisperer

Before casting Cobie Smulders in the iconic role of Canadian pop star turned journalist Robin Scherbatsky, the producers initially offered the role to Jennifer Love Hewitt. Hewitt ed on playing Robin, deciding to star in another CBS project, The Ghost Whisperer, which failed to even replicate half the success of HIMYM.

One of the reasons Smulders works so well in the role is because she is Canadian and has aided the writers and producers to get their facts right, but isn't afraid to roast her country of origin in the process. Beyond that, it would be insane to imagine the role of Robin being played by someone as famous as Hewitt, because it would more than certainly be distracting and take away from the complexity of Robin's character.

12. Neil Patrick Harris Wanted To Ban Britney Spears From Set

Britney Spears How I Met Your Mother

Neil Patrick Harris, who plays Barney, was really proud of the show and its content, but he believed it was selling out when the sitcom decided to have Britney Spears film multiple guest appearances. Spears famously played a receptionist who fell in love with Barney Stinson after a brief fling with him.

Harris believed that the only reason Spears was brought on was to draw in more viewers, which would only be beneficial to the higher-ups - not the fans. He believed that adding more guests stars for the sake of guest stars would only make the show and its comedy suffer, resulting in viewers dropping off in the long-term.

It turns out that Spears' team brought up a guest star role, so maybe the producers aren't the only ones to blame for her casting.

11. Alicia Silverstone Dropped The Role Of Stella Because of Britney Spears

Alicia Silverstone Clueless

Apparently, Neil Patrick Harris isn't the only one who had an issue with Britney Spears being in the show. Alicia Silverstone, best ed as Cher from the '90s classic Clueless, was originally slated to play Stella, the dermatologist who would date Ted over the course of the show's fourth season.

However, Silverstone bowed out of the role because she and her reps feared that she would be overshadowed by Britney Spears, who would be playing Stella's assistant. It turns out that Spears was much more important to the show as her star power could easily boost the show's rating.

Silverstone would have been a great fit for the role of Stella, but the producers saved face by casting Sarah Chalke of Scrubs fame, who gracefully played the role.

10. Cobie Smulders Battled Cancer During The Show

Cobie Smulders as Robin Scherbatsky on How I Met Your Mother

How I Met Your Mother is a show that has dealt with tragedy and illness in a respectful and nuanced way, but it's heartbreaking to know that some of the show's fictional woes steeped into reality as well. Well into the show's prime, Cobie Smulders was diagnosed with ovarian cancer in 2008. Just 25 at the time, Smulders didn't reveal her battle with ovarian cancer until the show was over - when she was 36.

Smulders cited spreading awareness for the disease and helping others get through such a tumultuous time when asked why she decided to reveal her diagnosis. Smulders was cancer-free two years later, after surgery and therapy, and currently has two daughters with her husband.

9. Josh Radnor Is Allergic To Robin's Dogs

Ted holding the blue french horn in How I Met Your Mother.

Josh Radnor is, by all means, a great actor, but just like the rest of us, he suffers from allergies that affected his performance. The reason his allergies are so prominent is that he would eventually date Robin - a woman who has an almost unhealthy obsession with dogs. It turns out that the show's creators had no idea that Radnor was allergic to dogs until after he was cast.

Seeing as he would be spending a bunch of time with Robin and her dogs, paramedics were on set just in case Radnor had a severe reaction. Many fans were left confused when Robin's dogs disappeared from the show's narrative in season 2, but it turns out that they were written out because of Radnor's allergies, which clears up one loose end.

8. Yellowface Controversy

Ted Mosby in yellow face as Marshall travels to China to figure out the secret of the slap of a thousand suns in How I Met Your Mother

One of the biggest missteps of the show happened in season 9, when the show was criticized for its portrayal of Asian people and the use of Yellowface. Focusing on Marshall traveling to Asia to learn how to give Barney the best (or depending on how you see it, the worst) slap of his life, the episode "Slapsgiving 3: Slappointment in Slapmarra" featured the main cast dres in stereotypical Asian get-ups with yellowface and fake mustaches.

While the creators meant no harm, citing the episode as an unabashed, immature, love-letter to Kung-Fu films, many were shocked and appalled at the show's blatant racism towards Asian audience . The creators later apologized, realizing why the joke didn't land as well as they would have hoped.

7. There Have Been 3 Failed Spin-Offs

How I Met Your Dad

Hoping to catch lightning in a bottle again, CBS and the show's creators attempted to create a spin-off that was told from the perspective of another mother. The show, titled How I Met Your Dad, would be set in another bar and focus on a different cast of characters, which included Oscar nominee Greta Gerwig, who would play the mother. Meg Ryan was slated to play the older mother. Unfortunately, the pilot was never picked up.

Another spin-off, titled How I Met Your Father, was conceived of in 2016, but no pilot was shot and the show was eventually abandoned. However, the idea didn't stay dead for too long, as just last year, the idea was brought up once again, this time under a different crew. As of now, nothing has come out of the spin-off, and the show will most likely never come to fruition.

6. Josh Radnor Was Sued For His Big Deck

Kyle McLaughlin as The Captain and Josh Radnor as Ted Mosby on How I Met Your Mother

Being rich and famous does mysterious things to those who want a big deck, because after all, who doesn't want one? Josh Radnor was sued over his house having a huge deck. The lawsuit stated that the previous owner had the right to extend into the neighbor's property if they maintained the walkaway and a wall, which Radnor clearly didn't care for.

Radnor didn't care for the rules and knocked over the wall, which in turn extended his deck, making it extend to the neighbor's property. After refusing to tear down the deck, Radnor was sued for not adhering to the previously agreed upon rules. It turns out that How I Met Your Mother money and fame doesn't allow you to play architect whenever you'd like.