Add test for TypeError