Fixes to last refactoring