Add test to check for TypeError on invalid string