Merge branch 'bug-1050' into bug-1042