Miniaod ports of #4914 #4833 #4862 #5037 #5230  plus #5425 and other fixes

This PR should include all fixes from