Corrected refactoring errors from switch to new typing system.