Some more fixes from the refactoring