fix #1496
Merge pull request #695 from jygaulier/3.8-fix1496

[WIP][3.8] fix #1496