Fix a bunch of errors incurred from refactoring.