MT#5301 Add upstream fixes