Backport of v2.
Working.