Related to #1980 (cherry picked from commit 999962bd2f)
999962bd2f
Fixes #1839 (cherry picked from commit 53d7622a3a)
53d7622a3a