fixed a couple of bugs in module Plan