Partial revert of 49b08cb586092b234b63e3fdddb9be4469f6a422.