Raise Invalid instead of returning null on invalid pstruct type
Discovered other ways a pstruct can go bad

E.g. missing fields in mappings, or mappings containing
values of unexpected types.