Fix bug #21192. Thanks to John Darrington for review.