misc changes to make planning more robust.