Fix for #3430.
Merge pull request #3431 from Segrain/master

Bugfix.