Fix a variety of issues and bugs related to elastic rebalance and related undo management