Fixes to internal error typing.