MT#5301 add upstream fixes