Backport to 2.3.x fix for #1577
Merge pull request #1815 from yakky/feature/1577_backport_23

Backport to 2.3.x fix for #1577