Fixed some bugs that popped up after refactoring.