MT#5301 Add upstream bug fixes