Add TypeError and associated tests.