Merged Pooling features from lateau with latest changes from downstream master.