fix undefined variable in error path
fix undefined variable in error path

not straightforward how to cover, so leave for now.

also scatter some TODO's from observing surrounding code.

stcorp/muninn,stcorp/muninn