There are a few places in the code like this that need more descriptive error messages.