MDP fixes

Fixes discovered when testing mdp.