More casting

Should this be `InvalidTypeError of string`