Additional fixes. Still to be tested.