Truncate long types in error messages

Fixes #542.

String representations of types in error messages are now cut off after 100 characters.