Fixes after refactoring