Merge pull request #3774 from 9rnsr/2.066

Cherry-picking commits from master to 2.066 branch (for beta5)