Fix: cleanup when exceptions are thrown.
Fix: memory leak in NodeFunction::optimize. After using evaluate, the nodes were not freed.
Fix: derivatives of undefined functions.