Fixed bug in types module, leading to a wrong Exception message.