Fix string concatenation errors

Some error paths concatenate the output of "type" with a string,
which gives TypeError: cannot concatenate 'str' and 'type' objects,
rather than describing the actual error.

Closes #149