Fix some remaining issues with refactoring