Fixes some of the errors caused by refactoring.