Fix multilayered pooling.