Several fixes to the decision engine.