Fix regressions after refactoring