Test for #1638
Fix #1638: not my favorite solution but it'll do for 3.8.x
Merge branch '3.8.x'