As Tesla CEO Elon Musk grapples with the difficult job of executing on his massively ambitious and high-risk plan to create an electric car and energy powerhouse, it was crucial for his company to meet its quarterly goals for car shipments.

The electric car company said on Sunday that it shipped a record 24,500 cars in the third quarter, beating estimates, and reaffirmed that it would be able to ship 50,000 cars in the second half of the year. It’s the first quarter of this year where Tesla didn’t disappoint on its car shipment numbers.

Tesla’s goal is to deliver just under 80,000 cars during all of 2016. But by 2018, Tesla plans to ship 500,000 cars annually, a goal that was accelerated by two years to meet the seemingly high demand for Tesla’s next electric car, the Model 3.

Reassured by the latest car shipment numbers, investors sent Tesla’s shares up as much as 4.5% in Monday morning trading.

For more on the pros and cons of the Tesla, SolarCity deal watch our video.

The upbeat announcement by the company is a positive turn following a difficult summer. In the previous two quarters, Tesla fell short of its car shipment targets as the company struggled to ramp up production of both its Model S electric sedan and its newer Model X SUV. Early Model X cars suffered from technical problems, many stemming from the complicated swooping doors.

In August, Musk described the period of manufacturing struggles as “production hell,” and “a lot of hurt.” He said the company had emerged from those difficulties, which had given him “a lot of mental scar tissue,” in June.

However, in addition to the manufacturing problems, Tesla has also faced increasing pressure over the summer due to its Autopilot software, which uses computing, radar, and cameras to assist with driving. Earlier this year, a Tesla driver was killed in an accident while Autopilot was engaged.

Get Data Sheet, Fortune’s technology newsletter.

Since then, Tesla has upgraded its software so that it processes radar signals better. Musk has said the new software would have prevented that high-profile death.

But beyond the production and software fixes, Tesla’s bigger risks are in its aggressive future goals and its ferocious spending to reach those targets.

Shipping 500,000 cars annually within the next two years—a more than six-fold increase from this year’s annual goal—is not just audacious. It may be near impossible.

Critics point out that Tesla and Musk have routinely missed such ambitious goals in the past.

To deliver on its production goal, Tesla is building a huge battery factory outside of Reno, Nev. that will make new, low-cost batteries for its Model 3 car. Tesla is working with battery giant Panasonic on the so-called “Gigafactory.”

The Reno factory, along with a parallel push to increasing car production near San Francisco, has required major investments. In August, a Tesla regulatory filing revealed that it would be left with only $400 million in cash later this year while it was also spending to acquire solar installer SolarCity SCTY , which Musk helped build and where he is a major shareholder.

As a result of the cash crunch, Tesla now plans to raise additional money from debt and equity markets this year.

Hitting its quarterly and annual car shipments is critical for Tesla to raise more funds. Investors, already worried about Tesla’s risks, want to see that Tesla is making some predictable progress on the 500,000 car production goal.

Musk, with his plans for world domination, can rally Tesla’s thousands of engineers, sales folks and developers, but at some point the team must hit the goals in front of them.

After three quarters of hard work and struggling, Tesla appeared to have done just that.