Merge branch 'bug_5790' into 3.12-master