Nearly a year after replacing Travis Kalanick, Uber’s controversial co-founder and CEO, new boss Dara Khosrowshahi is finally delivering signs that the ride-sharing service is steering itself back on track.

Focused on reshaping a bad-boy corporate culture while also dumping unprofitable overseas operations, the 48-year-old Khosrowshahi was able to report a $2.45 billion profit for the first quarter of 2018, a sharp turnaround from the previous three months when Uber went $1.1 billion into the red.

But Uber’s problems are far from over. Not only is it facing growing competition but it has, at least temporarily, halted autonomous vehicle testing in Arizona in the wake of a fatal March crash. Like Kalanick before him, Khosrowshahi is a big believer in the self-driving technology that is expected to eventually displace the tens of thousands of human drivers who make up Uber’s biggest expense.

Now it risks falling behind rivals like Lyft and the ride-sharing service that Google spin-off Waymo will launch later this year.

A profit is a rarity for Uber — the last time coming in the third quarter of 2016 when it largely exited the Chinese market. And, after stripping out one-time gains and expenses, it still went $601 million into the red for January-to-March 2018 despite having revenues climb to $11.33 billion, up from $10.9 billion during the final three months of 2017.

“We plan to reinvest any overperformance even more aggressively this year, both in our core business as well in big bets like Uber Eats globally,” Khosrowshahi said.

The most recent quarter saw Uber sell off a Southeast Asian ride and food delivery service to Grab, a Singapore-based rival. It was the latest in a series of global cuts: the San Francisco-based company sold its Chinese operations to Didi Chuxing two years earlier, though it did take a minority stake in the Chinese challenger. Last year, Uber also took a minority stake in a new joint venture with Russia’s Yandex, which took over ride-sharing operations in Russia and other parts of Eastern Europe. That deal also closed during the most recent quarter.

Uber isn’t completely walking away from overseas operations, however. It reported that gross bookings, which include not only rides requested by customers, but food deliveries by its Uber Eats service, rose 55 percent year-over-year. While hard numbers weren’t released, Khosrowshahi indicated Uber had regained some market share in the U.S. after dropping below 80 percent last fall. That has limited the service’s ability to price its services high enough to climb solidly into the black.

Despite adding services like Uber Eats and paring down unprofitable operations, Uber continues to struggle to reduce the biggest expense it has to deal with: the cost of its drivers. If anything, that could press even higher as, on Wednesday, the company said it would start providing some health benefits for drivers and couriers in Europe, and may do elsewhere in the future.

Uber's aggressive autonomous vehicle program aims to remove drivers entirely in order to drive down the price of a ride.

Under Kalanick, Uber launched an aggressive autonomous vehicle program with the ultimate goal of removing drivers entirely in order to slash operating costs and drive the price of a ride down so low that millions of Americans will no longer bother to own a personal vehicle but switch to ride-sharing.

But the Pittsburgh-based project has run into a series of snags. In late 2016 it briefly pulled out of San Francisco after a tiff with California regulators. It shifted the primary focus of a pilot program to Phoenix, the same city where Waymo is testing its own autonomous prototypes. But, in March, an Uber-modified Volvo XC90 hit and killed a pedestrian despite having a back-up “operator” behind the wheel who was supposed to retake control in an emergency.

It was soon learned that Uber had disabled the SUV’s standard-issue collision avoidance system and its own autonomous technology failed to react despite spotting the pedestrian six seconds before the collision. The human driver was distracted and looking away at the time.

Uber initially said it would put the program on hold until a determination was released by the National Transportation Safety Board. On Wednesday, however, it said it was shutting down the Arizona project entirely and laying off 300 local workers.

Uber said it will resume pilot programs in Pittsburgh and San Francisco later this year, after the official NTSB ruling is released.

While it wasn’t a factor showing up on Uber’s balance sheet, Khosrowshahi has been actively working to move away from the frat boy culture that dominated the company during the early years — and which led to a variety of complaints and lawsuits. It has also tried to repair an image damaged by reports of sexual assaults against both drivers and passengers. Earlier this month the CEO decided to lift from Uber’s terms of service a requirement that victims engage in private mediation, something critics argued helped the company keep down media coverage.

Former Uber CEO Travis Kalanick leaves the Phillip Burton Federal Building on day three of the trial between Waymo and Uber Technologies on Feb. 7, 2018 in San Francisco. Justin Sullivan / Getty Images

Kalanick was forced out because of the growing controversies that had led many customers to stop using Uber — and Khosrowshahi is well aware that he needs to fix the company’s image before taking Uber public.

In the nearer term, Uber also announced a trio of investment firms will purchase $600 million worth of stock, a move valuing Uber at around $62 billion, or about $8 billion more than General Motors, which is planning to use self-driving vehicles for its own Maven sharing service starting in 2019.