Fixed sloppy refactoring-caused reference errors.