Partially revert 83ba5487, which accidentally reversed a bunch of good changes