fixing compilation errors and tweaking cache rebalance constants