Fixed the last of the errors with the refactoring