I've re-written this section to always use a biggus.ArrayStack so the chance of a dangling undefined `stack` should have gone away.