Fix old invalid references in refactored code