In Penknife, noticed nested functions are broken. Added lots of TODO comments in preparation for refactoring.