Manually merging changes from branch_v2plus_2981 into master. Issue #2981