Backport to 3.3.1 branch Fix/3.3.1/issue 3704