Fix a few side effects of refactoring