Try to keep this in lock step with changes made in c9980c21.