Forward port of  #6570 and #6637 to 74x

Forward port of  #6570 and #6637 to 74x