Backport to 2.x