Small optimization fix in Planner.