Fixed stacks being saved in the reverse order.