Latest patch from @cboyden on #2293747.