Test case for #1399

(cherry picked from commit 2491233d29a09184c5802df120a4eb25a8f85fbc)
Fix #1399

(cherry picked from commit 21c5770e9ac065b2dffb4df90ed6a200b4340f48)
Merge pull request #1400 from sjinks/issue-1399

[1.3.0] Fix #1399