4.x deprecations and backports from 5.x