Elon Musk and Tesla violated the National Labor Relations Act several times by threatening employees, retaliating against them, threatening to punish union membership, and firing at least one union supporter, a judge ruled Friday. Bloomberg first reported the news.

It's worth juxtaposing the alleged safety conditions of Tesla's factory with the safety of the cars it produces. In a recent vehicle safety report, Tesla said that its vehicles "are engineered to be the safest cars in the world." The same isn’t true for its factory, however, which for the past few years has been the target of more workplace safety investigations and fines than almost any other rival auto plant in the United States.

Tesla has long said that its cars are the safest in the industry. The National Highway Traffic Safety Administration (NHTSA) gave a perfect 5-star safety rating to Tesla’s Model S and Model X vehicles. After the Model 3 was also awarded a perfect rating, Tesla said that the three cars have the “lowest probabilities of injury of all cars ever tested” and dubbed the Model 3 as “the safest car ever built.”

The people making those cars, though, have said they work in difficult and sometimes unsafe conditions. In 2017, The Guardian reported that in pursuit of a factory of the future, Musk created "a culture of long hours under intense pressure, sometimes through pain and injury" for the sake of hitting production goals. That year, the safety advocate group Worksafe released a report analyzing why Tesla's injury rate was higher than the industry average.

In 2018, Buzzfeed News revealed that as a result of Tesla's ambitious production schedule, between 2012 and 2017 at least 180 employees said they were afflicted with partially or permanently disabling injuries and sought compensation for those injuries. Reveal published an investigative report into how Tesla left injuries out of its logs to present its workplace as safe. Reveal also reported that Musk’s own idiosyncrasies made his Fremont factory more dangerous. It’s hard to be safe when your boss hates the color yellow, the reverse beeping sound made by forklifts, and having “too many signs.”

In a blog post responding to Reveal, Tesla denied many of the claims made in the article and said its goal is to have "the safest car factory in the world." Tesla did not respond to a request for comment from Motherboard.

A March investigative report by Forbes noted that between 2014 and 2018, Tesla was the subject of 24 investigations by the California Occupational Safety and Health Administration (OSHA) that resulted in fines for 54 violations, eclipsing that of nearly every major U.S. auto plant in the period (even those that produced more vehicles). In July, Tesla employees told CNBC that they cut corners and labored in poor conditions to meet production goals. Bloomberg noted that in 2018, Tesla's factory workers took twice as much time off from work-related injuries or illnesses than in 2017, after adjusting for workforce growth.