Fixed a class cast exception that shows up in mercury use of transformer. Regression from previous refactor.