Allow type to be defined by "string" types
Updated error message
Updated example with more complex example