Fix crash upon trying to clone a type object.

Closes #128.