Many changes to get pooling working.