Fix a rebalance-related bug