Almost manually merged in changes for treatment five.