Reorganizing code and patching a bug involving improper stacking.