Applying rolled-up dist fixes (nearly done)