Fixed minor bugs in dynamic pooling