Use TypeError exception for type checks.