Reimplement r80900, was lost when code was moved around