Swapped Exceptions for TypeErrors where appropriate.