Port clustering improvements from 2.4.x to 2.6.x (master)