Fixes #3186
Merge pull request #3189 from mal/issue3186

Fixes #3186