Note these changes have not all been tested, so it is quite possible that some are necessary but not sufficient.