This just fixes all the code so it builds and works like before, but doesn't yet bring the support for replicated pools.