Partially revert e1f97e2 to pass new test cases