A Canadian railroad has withdrawn its objection to a $338 million settlement fund for victims of a fiery train derailment that claimed 47 lives in Quebec, removing the final obstacle to the fund’s approval.

A Canadian judge on Thursday gave conditional approval to changes to the settlement agreement to grant some legal protections to Canadian Pacific, paving the way for final approval in a U.S. courtroom on Friday.

U.S. bankruptcy trustee Robert Keach said he hopes payments will be made to victims by year’s end.

The settlement, worth $446 million in Canadian dollars, was the product of negotiations with about two dozen companies with potential liability. Much of downtown Lac Megantic, Quebec, was destroyed when the runaway train with 72 oil tankers derailed on July 6, 2013.