Fixed some runt ime bugs of planner.