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