Bring in Daniel's fix for issue 1958.