Merge pull request #3765 from Segrain/dev

Dev bugfixes.
Fix for #3770.