Fix #1397

(cherry picked from commit 3d970442b1de7a56854611e6f77a0b36dde1f683)
Merge pull request #1398 from sjinks/issue-1397

Fix #1397