This works around the macOS issue that the prior commit addresses. (cherry picked from commit 8e5814d972)
8e5814d972