@pelson, "yes" to both of these comments.  I considered the change to ValueError, but decided that was best left for a later PR, first because it could break user code, and second because I think this is not the only place where that switch should be made.