Ocwen Financial surprisingly returned to profitability in the third quarter of 2016, breaking a four-quarter streak of losses, but the company’s time in the black appears to be short-lived.

The nonbank reported Wednesday that it posted a net loss for the fourth quarter of 2016, but the loss is far smaller than the company reported during the same time period last year.

According to Ocwen, the company posted a net loss of $10.4 million (or $0.08 per share) in the fourth quarter, compared to a net loss of $224.3 million (or $1.79 per share) in the fourth quarter of 2015.

In the first quarter of this year, Ocwen posted a net loss of $111.2 million (or $0.90 per share), and in the second quarter, Ocwen reported a net loss of $87.2 million in the second quarter (or $0.71 per share).

Overall, the nonbank posted a net loss of $199.4 million (or $1.61 per share) for the full year 2016. That’s up from 2015 as well, when the company posted a net loss of $246.7 million (or $1.97 per share).

The full-year loss marks the company’s third straight year of finishing in the red.

As noted above, Ocwen took a net loss of $246.7 million in 2015, which followed a loss of $546 million in 2014.

But as Ocwen President and CEO Ron Faris noted in the company’s earnings release, Ocwen’s last two quarters have the company on a positive path for the future, as long as “legacy” issues continue to be addressed.

“We are pleased with the progress the company made in the second half of the year,” Faris said.

“Not only did we deliver significantly improved financial performance versus the first half of the year, we continued our industry leadership in helping struggling families remain in their homes through responsible loan modifications,” Faris continued.

“We also refinanced our corporate debt, improved our cost structure and raised our servicer ratings and rankings,” Faris added. “In addition, we continued to make progress towards resolving our major legacy legal and regulatory issues; but more progress is needed for us to complete our stabilization process.”

One of those legacy issues the company recently resolved is the mortgage servicing restrictions placed on it by the state of California.

The company announced late last week that it reached a $223 million settlement with the California Department of Business Oversight, which allows Ocwen to acquire new mortgage servicing rights in California.

Ocwen also rids itself of the independent monitor installed in the company’s operations for 18 months as part of the company’s previous settlement with the state.

As Ocwen noted, the cost of paying for the monitoring required by the nonbank’s various regulatory settlements has weighed on its business in the past.

In July 2016, Ocwen revealed that its mounting monitor costs totaled $147.5 million from Jan. 1, 2014 through June 30, 2016 from its various settlements with regulators.

Monitor costs also affected the company’s bottom line in the fourth quarter of 2016.

Overall, Ocwen said that its pre-tax loss for the fourth quarter of 2016 was $10.2 million.

The company said that its pre-tax results for the quarter were impacted by a number of significant items including but not limited to: $31.6 million of benefit from fair value changes related to Ginnie MaeFannie Mae, and Freddie Mac mortgage servicing rights (excluding runoff), $16.3 million of corporate debt refinance-related expenses, $12.5 million in potential regulatory settlement-related reserves, $8.5 million of regulatory monitor costs and $0.6 million of other items.

The company added that its servicing segment recorded $43.3 million of pre-tax income, inclusive of the MSR fair value changes, which was favorable compared to the prior quarter by $10.1 million.

For the full year 2016, the servicing business recorded a $6.5 million pre-tax loss, a decrease of $22.4 million over 2015. The   company credits this loss to offsetting most of the impact of lower revenue from UPB run-off and $75.4 million lower agency MSR sales-related gains versus 2015 by improving its cost structure in 2016 and successfully executing on the streamline HAMP modification program.

The company also noted that its lending segment incurred a $3.1 million pre-tax loss for the fourth quarter of 2016, $6.7 million unfavorable to the prior quarter, driven by a 10% decline in volumes and lower margins.

For the full year 2016, the lending business earned $10 million of pre-tax income, a decrease of $24 million versus 2015, driven by lower margins due to significantly lower HARP opportunities and increased expenses from investments in the business, the company said.