These should be `TypeError` and `ValueError`s, respectively.