Implemented handling type errors.