Backport fixes to make a 6.0.2