Fixed bug in generate_process_plan()