Fix for #6649.
Fix for #7330.
Fix for #7324.
Merge pull request #7332 from Segrain/master

Bugfixes.
Merge remote-tracking branch 'upstream/master' into dev-freeze
Merge pull request #7334 from PsiOmegaDelta/dev-freeze

Dev freeze