Bring back fix for #1489396, unintentionally removed in another pull request