Fix #938
(cherry picked from commit 1f468630adf86b83615eab093babd83d3571f142)