Fix a control-flow bug that prevented us from performing exactly as the C version does.  Simulating gotos is not fun.