fix bugs in plan_from_recipe