Record cause of TypeConversionException.
Refactored classes and objects used for authentication to support pluggable authentication.