Octave: fix bugs in output of cleanup code

Closes #35