Fix for #7232.
Fix for #7204.
Merge pull request #7254 from Segrain/master

Bugfixes.