Reverting revert of c77f6cde82434c6e9257b46eff74972733dc7198.