Some additional mred-related tweaks. original commit: fcedc30ee4787d955adab3e0e656332812685e25
original commit: 28b404307793f041bb3363135a2968e283855318