Fixed the #PF, (probably) fixed some balancing for index_stack.

I will have to test the balancing in test environment later.