Re-apply pull-request #3956 now that the CLA has been signed.