debug 12/10

fix the problem caused by __plan_elem() returning NULL.