Fix regressions of refactoring.