Corrected a few errors resulting from refactoring